Re: Multiple tuples for one for statement

2005-04-24 Thread Daniel Cer
Harlin Seritt wrote: I have three tuples of the same size: tup1, tup2, tup3 I'd like to do something like this: for a,b,c in tup1, tup2, tup3: print a print b print c Of course, you get an error when you try to run the pseudocode above. What is the correct way to get this done? For somethi

Re: pygtk and long running process

2005-04-24 Thread Daniel Cer
Daniel Cer wrote: Robert wrote: I have a command line app that can take up to 20 minutes to complete and every minute or so updates it's status (spits it out to console). I am writing a front end for this app in python/gtk and was wondering what command I use to a) invoke the command and b

Re: pygtk and long running process

2005-04-24 Thread Daniel Cer
Robert wrote: I have a command line app that can take up to 20 minutes to complete and every minute or so updates it's status (spits it out to console). I am writing a front end for this app in python/gtk and was wondering what command I use to a) invoke the command and b) how to capture it's out

Re: Canceling/interrupting raw_input

2005-04-18 Thread Daniel Cer
string thread.start_new_thread(inputLoop, () ) time.sleep(3) print "\nTime's up exiting...." win32api.TerminateProcess(-1, 0) -Dan Daniel Cer wrote: For what it's worth, this looks like a Windows specific problem. The code below seems to work as expected on a Linux box. That is, everythin

Re: Canceling/interrupting raw_input

2005-04-17 Thread Daniel Cer
For what it's worth, this looks like a Windows specific problem. The code below seems to work as expected on a Linux box. That is, everything terminates, including the "inputLoop", after sys.exit() is called, without the user needing to press 'enter' one last time. However, if I try to run the c

Re: assigning a custom mapping type to __dict__

2005-03-01 Thread Daniel Cer
> > Why not just inherit from dict? That seems to work. > > Because that isn't the question - Steven knows how to make it work, what he's > curious about is why things are the way they are :) Sorry, didn't mean to be a pest :) I guess I assumed Steve already knew that he could inherit from dict.

Re: assigning a custom mapping type to __dict__

2005-03-01 Thread Daniel Cer
Why not just inherit from dict? That seems to work. >>> class M(dict): ... def __getitem__(self,key): ... return 42 ... def __setitem__(self,key,value): ... pass ... >>> class C(object): ...pass ... >>> c = C() >>> c.__dict__ = M() >>> c.__dict__['x'] 42 -Dan Steven Bethard wrote: I