Re: Purely historic question: VT200 text graphic programming

2011-03-09 Thread Dan Stromberg
Hm, maybe curses? *ix programmers often know what it is, but it was present on VMS as well. And the python sources come with a curses module. http://h71000.www7.hp.com/doc/732final/5763/5763pro_015.html The main question then becomes, was VMS's curses a termcap curses or a terminfo curses, or so

Re: A question about Cmd Class

2011-03-09 Thread yuan zheng
Thanks. I understand your code , and print it. *Before replace:* `~!@#$%^&*()-=+[{]}\|;:'",<>/? * After replace:* `~!@#$%^&*()=+[{]}\|;:'",<>/? Certainly, the charactor ‘-’ has been deleted from delims. But there is nothing effect on my program after adding the code. My shell:

Purely historic question: VT200 text graphic programming

2011-03-09 Thread GrayShark
Once, many, many, years ago, I programmed some type of 'graphical' interface on a VT200 terminal (only DEC VAX/VMS programmers are going to know what this is). Question. What was the library I linked against? Yes, you remember, painting boxes with ascii and the superset of ascii. Thanks for th

Re: A question about Cmd Class

2011-03-09 Thread yuan zheng
Thanks for your help. thanks, yuanzheng. 2011/3/8 Dave Angel > On 01/-10/-28163 02:59 PM, yuan zheng wrote: > >> Hello, everyone: >> >> I encouter a question when implementing a commmand line(shell). >> I have implemented some commands, such as "start", "stop", "quit", >> they are easily i

Re: I found some very odd behaviour in Python's very basic types

2011-03-09 Thread Terry Reedy
On 3/10/2011 12:47 AM, Sunjay Varma wrote: For some reason, sub-classing and overwriting a built-in type does not change the behavior of the literal. Logically speaking, overwriting a name, such as str, should delete the basic str type, and replace it with the new class or object put in its place

Python Tools for Visual Studio from Microsoft - Free & Open Source

2011-03-09 Thread roland garros
FYI... http://pytools.codeplex.com Enjoy! -- http://mail.python.org/mailman/listinfo/python-list

I found some very odd behaviour in Python's very basic types

2011-03-09 Thread Sunjay Varma
For some reason, sub-classing and overwriting a built-in type does not change the behavior of the literal. Logically speaking, overwriting a name, such as str, should delete the basic str type, and replace it with the new class or object put in its place. For some reason though, even though the int

Code structure help

2011-03-09 Thread Martin De Kauwe
Hi, I have been working on re-writing a model in python and have been trying to adopt some of the advise offered on here to recent questions. However I am not sure how easy on the eye my final structure is and would appreciate any constructive comments/ suggestions. So broadly the model estimates

Re: my computer is allergic to pickles

2011-03-09 Thread Miki Tebeka
> >From looking at the shelve info in the library reference, I get > the impression it's tricky to change the values in the dict for > existing keys and be sure they get changed on disk. You can use writeback=True or call sync at the right places. > How can you convert a tuple of strings to a str

Re: attach to process by pid?

2011-03-09 Thread Miki Tebeka
> Is there any way to attach to an already running process by pid? I want to > send > commands from python to an application that is already running. I don't want > to > give the command name to subprocess.Popen. We probably need more information. What do you mean by "send commands"? (What was

Re: having both dynamic and static variables

2011-03-09 Thread alex23
"BartC" wrote: > Another example: > > pi=3.141592654 > > print ("pi is:",pi) > > pi=42 > > print ("pi is now:",pi) > > which is clearly undesirable. Maybe not if you're the state of Indiana :) -- http://mail.python.org/mailman/listinfo/python-list

Re: OT: Code Examples

2011-03-09 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote: > Paul Rubin wrote: > > > Anyway, try googling "evil mangler" > > I know what the "evil mangler" is. It was called that because it > threw away all the principles of good software design in favour > of expediency. GHC now has a new LLVM backend which does not > depend o

Re: Don't Want Visitor To See Nuttin'

2011-03-09 Thread Ian
On 09/03/2011 21:01, Victor Subervi wrote: The problem is that it prints "Content-Type: text/html" to the screen If you can see what is intended to be a header, then it follows that you are not sending the header correctly. Sorry - can't tell you how to send a header. You don't say what frame

mrjob v0.2.4 released

2011-03-09 Thread Jimmy Retzlaff
What is mrjob? --- mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Som

Re: How Translate This PHP

2011-03-09 Thread Victor Subervi
On Sun, Mar 6, 2011 at 12:00 PM, Noah Hall wrote: > On Sun, Mar 6, 2011 at 3:11 PM, Victor Subervi > wrote: > > Ah. I thought I had to "return" something! > > Well, based on what you asked, you would've, but based on the code, > all it was doing is printing "returnValue - value" > > Of course, a

Re: my computer is allergic to pickles

2011-03-09 Thread Peter Otten
Bob Fnord wrote: > I'm using python to do some log file analysis and I need to store > on disk a very large dict with tuples of strings as keys and > lists of strings and numbers as values. > > I started by using cPickle to save the instance of the class that > contained this dict, but the pickli

Re: my computer is allergic to pickles

2011-03-09 Thread Bob Fnord
Terry Reedy wrote: > On 3/7/2011 4:50 AM, Bob Fnord wrote: > > > I want a portable data file (can be moved around the filesystem > > or copied to another machine and used), > > Used only by Python or by other software? just Python > > Would a database in a file have any advantages over a file

Re: my computer is allergic to pickles

2011-03-09 Thread Bob Fnord
"Martin P. Hellwig" wrote: > On 05/03/2011 01:56, Bob Fnord wrote: > > > Any comments, suggestions? > > > No but I have a bunch of pseudo-questions :-) > > What version of python are you using? How about your OS and bitspace > (32/64)? Have you also tried using the non-c pickle module? If the

Re: error in exception syntax

2011-03-09 Thread Aaron Gray
"Aaron Gray" wrote in message news:8tpu87f75...@mid.individual.net... On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the following error :- File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 except OSError, err: ^ It works o

Re: multiprocessing module in async db query

2011-03-09 Thread Philip Semanchuk
On Mar 9, 2011, at 10:22 AM, Sheng wrote: > Hi Philip, > > multiprocessing.Queue is used to transfer data between processes, how > it could be helpful for solving my problem? Thanks! I misunderstood -- I thought transferring data between processes *was* your problem. If both of your functions

Re: attach to process by pid?

2011-03-09 Thread Danny Shevitz
> Have a look at the SIMPL toolkit. http://www.icanprogram.com/06py/lesson1/lesson1.html > > This should be able to do exactly what you want. > > bob Does this work on Mac OS X? thanks, Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: having both dynamic and static variables

2011-03-09 Thread BartC
"Steven D'Aprano" wrote in message news:4d743f70$0$29984$c3e8da3$54964...@news.astraweb.com... On Sun, 06 Mar 2011 12:59:55 -0800, Westley Martínez wrote: I'm confused. Can someone tell me if we're talking about constant as in 'fixed in memory' or as in 'you can't reassign' or both? Python

Re: error in exception syntax

2011-03-09 Thread Peter Otten
Aaron Gray wrote: > On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting > the following error :- > > File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 > except OSError, err: > ^ > > It works okay on my Linux machine running Pyth

Re: error in exception syntax

2011-03-09 Thread Tim Golden
On 09/03/2011 6:12 PM, Aaron Gray wrote: On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the following error :- File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 except OSError, err: ^ It works okay on my Linux machine r

Re: error in exception syntax

2011-03-09 Thread MRAB
On 09/03/2011 18:12, Aaron Gray wrote: On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the following error :- File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 except OSError, err: ^ It works okay on my Linux machine running Python 2.6.2. Many than

Re: error in exception syntax

2011-03-09 Thread Alex Willmer
On Mar 9, 6:12 pm, "Aaron Gray" wrote: > On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the > following error :- > >     File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 >       except OSError, err: >                 ^ > > It works okay on my Linux m

Re: Finding keywords

2011-03-09 Thread Cross
On 03/09/2011 01:21 AM, Vlastimil Brom wrote: 2011/3/8 Cross: On 03/08/2011 06:09 PM, Heather Brown wrote: The keywords are an attribute in a tag called, in the section called . Are you having trouble parsing the xhtml to that point? Be more specific in your question, and somebody is likely t

error in exception syntax

2011-03-09 Thread Aaron Gray
On Windows I have installed Python 3.2 and PyOpenGL-3.0.1 and am getting the following error :- File "c:\Python32\lib\site-packages\OpenGL\platform\win32.py", line 13 except OSError, err: ^ It works okay on my Linux machine running Python 2.6.2. Many thanks in advance,

Re: attach to process by pid?

2011-03-09 Thread bobicanprogram
On Mar 8, 7:49 pm, James Mills wrote: > On Wed, Mar 9, 2011 at 9:20 AM, Danny Shevitz wrote: > > Is there any way to attach to an already running process by pid? I want to > > send > > commands from python to an application that is already running. I don't > > want to > > give the command name

Re: multiprocessing module in async db query

2011-03-09 Thread Sheng
Hi Philip, multiprocessing.Queue is used to transfer data between processes, how it could be helpful for solving my problem? Thanks! Sheng On Mar 8, 6:34 pm, Philip Semanchuk wrote: > On Mar 8, 2011, at 3:25 PM, Sheng wrote: > > > This looks like a tornado problem, but trust me, it is almost al

Re: attach to process by pid?

2011-03-09 Thread Grant Edwards
On 2011-03-09, Danny Shevitz wrote: > >> process has some kind of communication(s) interface; eg: >> * some kind of listening socket >> * some kind of I/O (pipe, stdin/stdout) > > It does have a stdin/stdout. How do I access it? You don't. You access the "other end" of the pipe or pty to which

Re: Python fails on math

2011-03-09 Thread Mark Dickinson
On Feb 25, 12:52 am, Grant Edwards wrote: > So I think the C standard actually > forces the compiler to convert results to 64-bits at the points where > a store to a temporary variable happens. I'm not sure that this is true. IIRC, C99 + Annex F forces this, but C99 by itself doesn't. > Indeed.

Re: attach to process by pid?

2011-03-09 Thread Danny Shevitz
> process has some kind of communication(s) interface; eg: > * some kind of listening socket > * some kind of I/O (pipe, stdin/stdout) It does have a stdin/stdout. How do I access it? thanks, D -- http://mail.python.org/mailman/listinfo/python-list

Re: my computer is allergic to pickles

2011-03-09 Thread Bob Fnord
Miki Tebeka wrote: > > Or, which situations does shelve suit better and which does > > marshal suit better? > shelve ease of use and the fact it uses the disk to store objects makes it a > good choice if you have a lot of object, each with a unique string key (and a > tuple of strings can be co

Re: Finding keywords

2011-03-09 Thread Steven D'Aprano
On Tue, 08 Mar 2011 12:48:11 +0530, Cross wrote: > Hello > > I have got a project in which I have to extract keywords given a URL. I > would like to know methods for extraction of keywords. Frequency of > occurence is one; but it seems naive. I would prefer something more > robust. Please suggest

Re: Reference Cycles with instance method

2011-03-09 Thread Duncan Booth
Amit Dev wrote: > The object is not garbage collected, since there appears to be a cycle > (between method m2 and A). I would expect this to behave the same as > having another method "def m2(self): self.m1()", but unfortunately its > not. > In above case m2 seems to be in a.__dict__ which is cau

Re: Deploying on Windows servers : advice sought a module

2011-03-09 Thread Rory Campbell-Lange
On 08/03/11, Waldemar Osuch (waldemar.os...@gmail.com) wrote: > At my work place I still use py2exe but I do not rely on its automatic > discovery and packaging. > > The setup.py lists all the dependencies explicitly in "packages" and > "includes" parameters. These end up in library.zip. > > The

Re: Python fails on math

2011-03-09 Thread Ben
On Feb 25, 12:33 am, Steven D'Aprano wrote: > On Thu, 24 Feb 2011 10:40:45 -0600, Robert Kern wrote: > > On 2/24/11 5:55 AM, Steven D'Aprano wrote: > >> On Wed, 23 Feb 2011 13:26:05 -0800, John Nagle wrote: > > >>> The IEEE 754 compliant FPU on most machines today, though, has an > >>> 80-bit inte

Re: python cmd.Cmd auto complete feature

2011-03-09 Thread Jean-Michel Pichavant
Peter Otten wrote: Jean-Michel Pichavant wrote: I'm trying to autoexpand values as well as arguments using the builtin cmd.Cmd class. I.E. Consider the following command and arguments: > sayHello target=Georges 'Hello Georges !' I can easily make 'tar' expand into 'target=' however I'd l

Re: Dijkstra Algorithm Help

2011-03-09 Thread Ulrich Eckhardt
yoro wrote: > Thanks for replying, maybe i'm misunderstanding your comment - > nodeTable is used to store the distances from source of each node > within a text file, the file having the format : > > 1,2,3,4,5,6,7,8,9 > 1,2,3,4,5,6,7,8,9 > > Each of these nodes will have the same settings as set

Re: Dijkstra Algorithm Help

2011-03-09 Thread Tim Roberts
yoro wrote: > >Thanks for replying, maybe i'm misunderstanding your comment - Yes, it was not clear at first glance that you are calling populateNodeTable twice. You call it once and throw away the result, then you call it again and pass the result to tentativeDistance. That's probably not what

Re: Reference Cycles with instance method

2011-03-09 Thread Peter Otten
Amit Dev wrote: > Simple question. If I have the following code: > > class A: > def __init__(self, s): > self.s = s > self.m2 = m1 > > def m1(self): > pass > > if __name__ == '__main__': > a = A("ads") > a.m1() > a = None > > The object is not garbag