Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
On Tuesday 05 December 2006 23:32, Alan Gauld wrote: > "Dave S" <[EMAIL PROTECTED]> wrote > > > Struggling with python & XP again. My app needs to know if a certain > > program > > is running on my XP box > > > > os.execl('') > > It throws the output to the terminal + I need the exact path to t

Re: [Tutor] Integer?

2006-12-05 Thread Dick Moores
At 09:40 PM 12/5/2006, wesley chun wrote: > > > How can I check if a variable is an integer? > > > > Luke and John have answered your question, but we should also ask, why > > do you want to do that? Explicit type testing is a code smell, perhaps > > there is a better way to do what you want. > > >

[Tutor] order of arguments in function

2006-12-05 Thread Dick Moores
Say I have a function, def my_function(max, min=0): return max - min The order of arguments is counterintuitive, but it seems it can't be changed if I want to have a default min. Is there way to write def my_function(min=0, max): stuff Thanks, Dick Moores

Re: [Tutor] Integer?

2006-12-05 Thread wesley chun
> > How can I check if a variable is an integer? > > Luke and John have answered your question, but we should also ask, why > do you want to do that? Explicit type testing is a code smell, perhaps > there is a better way to do what you want. - another way of doing it is: type(aVar) is int (which

Re: [Tutor] Integer?

2006-12-05 Thread Kent Johnson
Eli Zabielski wrote: > How can I check if a variable is an integer? Luke and John have answered your question, but we should also ask, why do you want to do that? Explicit type testing is a code smell, perhaps there is a better way to do what you want. Kent

Re: [Tutor] How to pass multiple variables in callback function?

2006-12-05 Thread Kent Johnson
Alan Gauld wrote: > "Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote > >> I mean to say that suppose I have two lists, and I want to pass them >> to the >> event handling function. Is that possible using bind? > > Not answering your question directly but you can do > it with a lambda expression. >

[Tutor] Docs for os popen and Popen2 modules

2006-12-05 Thread Tony Cappellini
Running python 2.3.4, on Windows XP the popen2 docs show 6.8 popen2 -- Subprocesses with accessible I/O streams This module allows you to spawn processes and connect to their input/output/error pipes and >>obtain their return codes under Unix and Windows.<< Then it further goes to say The onl

Re: [Tutor] Integer?

2006-12-05 Thread John Fouhy
On 06/12/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: > Eli Zabielski wrote: > > How can I check if a variable is an integer? > if type(aVar) == type(1): Well, you could also do "type(aVar) == int", which is clearer. Or "type(aVar) in (int, long)", depending on exactly what you mean by "integ

Re: [Tutor] Integer?

2006-12-05 Thread Luke Paireepinart
Eli Zabielski wrote: > How can I check if a variable is an integer? if type(aVar) == type(1): should do the trick. > > > ___ > Tutor maillist - Tutor@python.org > http://mail.pyth

[Tutor] Integer?

2006-12-05 Thread Eli Zabielski
How can I check if a variable is an integer? ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] which file runs

2006-12-05 Thread Christopher Arndt
Chris Hengge wrote: > I have a script that makes my python scripts into .pyc files and I can > run those without a .py in the directory or anywhere else on the system > for that matter. No clever tricks needed. You're right. Probably this trick was only needed in (very) old versions of Python.

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Alan Gauld
"Dave S" <[EMAIL PROTECTED]> wrote > Struggling with python & XP again. My app needs to know if a certain > program > is running on my XP box > os.execl('') > It throws the output to the terminal + I need the exact path to the > executable > (a bit of a trial) > Any ideas how I can catch

Re: [Tutor] How to pass multiple variables in callback function?

2006-12-05 Thread Alan Gauld
"Asrarahmed Kadri" <[EMAIL PROTECTED]> wrote > I mean to say that suppose I have two lists, and I want to pass them > to the > event handling function. Is that possible using bind? Not answering your question directly but you can do it with a lambda expression. def myfunc(l1,l2): # the func

Re: [Tutor] which file runs

2006-12-05 Thread Alan Gauld
"Luke Paireepinart" <[EMAIL PROTECTED]> wrote >> I have a script that makes my python scripts into .pyc files and I >> can >> run those without a .py in the directory or anywhere else on the >> system for that matter. No clever tricks needed. >> > Why would you want to do this? I haven't measur

Re: [Tutor] How to kill an app from python on windows? (Tim Golden)

2006-12-05 Thread Paulino
[EMAIL PROTECTED] escreveu: > >1. Re: How to kill an app from python on windows? (Tim Golden) > > > This link may get you started: > > http://effbot.org/pyfaq/how-do-i-emulate-os-kill-in-windows.htm > > although it may not apply, depending on the exact > circumstances of what you're doing. >

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
On Tuesday 05 December 2006 22:42, Luke Paireepinart wrote: > Dave S wrote: > > On Tuesday 05 December 2006 20:58, Luke Paireepinart wrote: > >> Dave S wrote: > >>> Hi all, > >>> > >>> Struggling with python & XP again. My app needs to know if a certain > >>> program is running on my XP box > >>> >

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Luke Paireepinart
Dave S wrote: > On Tuesday 05 December 2006 20:58, Luke Paireepinart wrote: > >> Dave S wrote: >> >>> Hi all, >>> >>> Struggling with python & XP again. My app needs to know if a certain >>> program is running on my XP box >>> >>> Ideal world - I can get the output of 'tasklist.exe' into a

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
On Tuesday 05 December 2006 20:58, Luke Paireepinart wrote: > Dave S wrote: > > Hi all, > > > > Struggling with python & XP again. My app needs to know if a certain > > program is running on my XP box > > > > Ideal world - I can get the output of 'tasklist.exe' into a string. > > > > I have tried >

Re: [Tutor] XP & catching execl o/p ?

2006-12-05 Thread Luke Paireepinart
Dave S wrote: > Hi all, > > Struggling with python & XP again. My app needs to know if a certain program > is running on my XP box > > Ideal world - I can get the output of 'tasklist.exe' into a string. > > I have tried > > os.execl('') > It throws the output to the terminal + I need the exact

Re: [Tutor] which file runs

2006-12-05 Thread Chris Hengge
Quick and dirty way to keep people from lookin at the code. On 12/5/06, Luke Paireepinart <[EMAIL PROTECTED]> wrote: Chris Hengge wrote: > I have a script that makes my python scripts into .pyc files and I can > run those without a .py in the directory or anywhere else on the > system for that

[Tutor] XP & catching execl o/p ?

2006-12-05 Thread Dave S
Hi all, Struggling with python & XP again. My app needs to know if a certain program is running on my XP box Ideal world - I can get the output of 'tasklist.exe' into a string. I have tried os.execl('') It throws the output to the terminal + I need the exact path to the executable (a bit

Re: [Tutor] which file runs

2006-12-05 Thread Luke Paireepinart
Chris Hengge wrote: > I have a script that makes my python scripts into .pyc files and I can > run those without a .py in the directory or anywhere else on the > system for that matter. No clever tricks needed. > Why would you want to do this? ___ Tutor

Re: [Tutor] which file runs

2006-12-05 Thread Chris Hengge
I have a script that makes my python scripts into .pyc files and I can run those without a .py in the directory or anywhere else on the system for that matter. No clever tricks needed. On 12/1/06, Christopher Arndt <[EMAIL PROTECTED]> wrote: Addendum: these rules only apply to Python *modules*.

[Tutor] How to pass multiple variables in callback function?

2006-12-05 Thread Asrarahmed Kadri
Hi folks, Is it possible to pass parameters using bind ? I mean to say that suppose I have two lists, and I want to pass them to the event handling function. Is that possible using bind? Thanks. Regards, Asrarahmed Kadri -- To HIM you shall return.

Re: [Tutor] how to save wxpython output

2006-12-05 Thread Kent Johnson
Ketan Maheshwari wrote: > Hi *: > How do I save the output of a wxpython program as a jpg or png image > from within the program? What output do you want to capture? Do you mean you want a screenshot of the windows? On Windows you can use ImageGrab from the Python Imaging Library to capture

[Tutor] Running drPython and other Pythonscript on Macintosh OS/X

2006-12-05 Thread Anders Persson
Hi! I try to learn my son Development using Python. I have found that drPython was a great enviroment and easy for him to understand. Is't a problem running om Macintosh OS/X i have to start on commandline, OS/X dosen't understand when i clicked on the drPython.py files. I have found this is s

Re: [Tutor] Tutor Digest, Vol 34, Issue 7

2006-12-05 Thread Alan Gauld
"Lazarus billa" <[EMAIL PROTECTED]> wrote > When I wanted to Browse "[EMAIL PROTECTED]" I am not > able to get it and it indicates "cannot find server > due to Syntax Error." Plz Advise. It means you've made a mistake in your code. Can you give us a clue by including some code? That way we migh