Re: Dictionary bidirectional

2008-07-14 Thread Ken Starks
Dennis Lee Bieber wrote: On Sun, 13 Jul 2008 16:21:11 -0700 (PDT), Kless <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: I need a dictionary where get the result from a 'key' (on left), but also from a 'value' (on right), how to get it? I know that dictionaries aren't bidirect

Re: subprocess module

2008-07-14 Thread Peter Otten
John Mechaniks wrote: > from subprocess import call > call(['ls', '-l']) > > How do I get the result (not the exit status of the command) of "ls - > l" into a variable? output = subprocess.Popen(["ls", "-l"], stdout=subprocess.PIPE).stdout.read() Peter -- http://mail.python.org/mailman/listinfo

subprocess module

2008-07-14 Thread John Mechaniks
from subprocess import call call(['ls', '-l']) How do I get the result (not the exit status of the command) of "ls - l" into a variable? -- http://mail.python.org/mailman/listinfo/python-list

Re: while var, but var ==16 != true

2008-07-14 Thread John Machin
On Jul 14, 3:32 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > maestro <[EMAIL PROTECTED]> wrote: > > >why does this work?  "while p" = "while p != 0" ? 1 is True and 0 is > >false in python but other numbers have no boolean value so why doesnt > >it abort. > > Because your statement is incorrect.  E

Re: Dictionary bidirectional

2008-07-14 Thread Kless
But in my dictionary both keys and values are unique. On Jul 14, 7:34 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 13 Jul 2008 16:21:11 -0700 (PDT), Kless > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > I need a dictionary where get the result from a 'key' (o

Simple Image Cropper

2008-07-14 Thread Mr SZ
Hi, I am designing a simple image cropper which simply takes an image and use PIL to do the cropping.Now in order to do the cropping I simply draw a rectangle on the image by dragging the mouse over the image.I then use button press and button release events to find the mouse postition and send

Re: iterator clone

2008-07-14 Thread Yosifov Pavel
> `tee()` doesn't copy the iterator or its internal state but just caches > it's results, so you can iterate over them again. That makes only sense > if you expect to use the two iterators in a way they don't get much out of > sync. If your usage pattern is "consume iterator 1 fully, and then > r

Re: About wmi

2008-07-14 Thread patrol
On 7月14日, 下午12时29分, Larry Bates <[EMAIL PROTECTED]> wrote: > patrol wrote: > > On 7月13日, 下午10时26分, Larry Bates <[EMAIL PROTECTED]> wrote: > >> patrol wrote: > >>> I want to prevent some process from running. The code is in the > >>> following. I encounter some unexpected troubles. > >>> Probelm1:

Re: Beginner Question : Iterators and zip

2008-07-14 Thread cokofreedom
> > zip(*vec_list) will zip together all entries in vec_list > Do be aware that zip stops on the shortest iterable. So if vec[1] is > shorter than vec[0] and matches otherwise, your output line will be > truncated. Or if vec[1] is longer and vec[0] matches as far as it goes, > there will be no si

Re: Why is there no GUI-tools like this for Windows?

2008-07-14 Thread Martin Walsh
maestro wrote: > I can just do the layout with my mouse and then there is a program > that writes the code for me. > GUI-programming is hard for no reason. One good program then forever > easy... > > Is there not something like this for Python/Windows? Is the Linux one > only for ruby or for any l

Re: spam

2008-07-14 Thread David Brown
rickman wrote: spam *Why* are you replying to spam messages like this? The spam in c.a.e. usually costs me about 10-15 seconds a day pressing "K" for "kill thread" on my newsreader - but your bizarre new habit has cost me far more in trying to think out a rational explanation for your posts

<    1   2