[Tutor] pyHook related doubt

2008-04-29 Thread Muguntharaj Subramanian
Hi All, I am trying to create a custom keyboard driver program(like http://www.tavultesoft.com/keyman/ ) for windows using python. If this python script is run in the background, what is typed should be converted into my native language. For example if I hit 'a' in the keyboard, the output of the k

Re: [Tutor] Tutor Digest, Vol 50, Issue 84

2008-04-29 Thread Tony Cappellini
I think you may have to send a message to the event look of you application manually, to let it know you have a key event for it. You may also need to temporarily enable/disbale the keydown event handler for pyHook, or else you wont be able to easily break out of that code (at least I couldn't) :-

[Tutor] removing subscription

2008-04-29 Thread Kriti Satija
Remove my mail id from that i have subsribed in Python Tutor List. Did you know? You can CHAT without downloading messenger. Go to http://in.messenger.yahoo.com/webmessengerpromo.php/ ___ Tutor maillist - Tutor@python.org http://mail.python.o

Re: [Tutor] removing subscription

2008-04-29 Thread Timmie
Kriti Satija yahoo.co.in> writes: > > Remove my mail id from that i have subsribed in > Python Tutor List. Please do this by yourself going at the site mentioned in the mail footer: > ___ > Tutor maillist - Tutor python.org > http://mail.python.or

[Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Scott SA
Per the interesting read at Can anyone explain the rationale behind this: - More than one space around an assignment (or other) operator to align it with another. Yes: x = 1 y = 2 long_variable = 3

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Marc Tompkins
On Tue, Apr 29, 2008 at 9:22 AM, Scott SA <[EMAIL PROTECTED]> wrote: >- More than one space around an assignment (or other) operator to > align it with another. > When I first started in Python, I was lining up all of my variable assignments in blocks; I, too, find it more readable. But

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Michael Langford
This, like many style guidelines, is not something that necessary has an irrefutable reason. Sort of like driving on the left or right side of the road, it is pretty much custom. You'll get use to coding like that after a short time if you start. If you don't, nothing bad will happen to you, just

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread W W
Even with monospace, I can't really see it being that helpful, after all, in: x = 3 y = 5 foobar_fun = 20 3 and 5 are in no way related, x and 3 are. However, sometimes I break them up into more beautiful chunks: x = 3 y = 5 foobar_fun = 20 sometimes it's more helpful that way. just my 2.5c -

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Alan Gauld
"W W" <[EMAIL PROTECTED]> wrote Even with monospace, I can't really see it being that helpful, after all, in: x = 3 y = 5 foobar_fun = 20 3 and 5 are in no way related, x and 3 are. However, sometimes I break them up into more beautiful chunks: In Python it doesn't make much difference b

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Scott Sandeman-Allen
On 4/29/08, Marc Tompkins ([EMAIL PROTECTED]) wrote: >On Tue, Apr 29, 2008 at 9:22 AM, Scott SA <[EMAIL PROTECTED]> wrote: > >>- More than one space around an assignment (or other) operator to >> align it with another. >> > When the guy who invented the language >tells me I'm doing it wro

[Tutor] string from input file

2008-04-29 Thread Bryan Fodness
I am trying to get values from an input file, 0.192 Custom 15 IN but, when I check to see if they are equal it is not true. f = open(infile, 'r') s = f.readlines() f.close() Block = str(s[1]) Angle = float(s[2]) Position = str(s[3]) if Bloc

Re: [Tutor] string from input file

2008-04-29 Thread Hansen, Mike
> -Original Message- > On > Behalf Of Bryan Fodness > Sent: Tuesday, April 29, 2008 3:54 PM > To: tutorpythonmailinglist Python > Subject: [Tutor] string from input file > > I am trying to get values from an input file, > > 0.192 > Custom > 15 > IN > > but, when

Re: [Tutor] string from input file

2008-04-29 Thread Sander Sweers
On Tue, Apr 29, 2008 at 11:54 PM, Bryan Fodness <[EMAIL PROTECTED]> wrote: > I am trying to get values from an input file, > > 0.192 > Custom > 15 > IN > > but, when I check to see if they are equal it is not true. > > f = open(infile, 'r') > s = f.readlines() > f

Re: [Tutor] string from input file

2008-04-29 Thread Alan Gauld
"Bryan Fodness" <[EMAIL PROTECTED]> wrote f = open(infile, 'r') s = f.readlines() f.close() This just reads the lines as text from the file. It includes any whitespace and linefeeds in the file. Block = str(s[1]) Since its text you don;t need the str() but you probably shoul

Re: [Tutor] Python Best Practice/Style Guide question

2008-04-29 Thread Arthur
i like to write variable the kamelWay (i learned it from some javascript book some time ago) but i never use spaces even in between : variableName=variableValue. i guess i like compact code with fewer lines ... always thought shorter programs run faster... & it also makes you feel that your way it