Re: Trying to run an external program

2006-09-21 Thread Larry Bates
Brant Sears wrote: > Hi. I'm new to Python and I am trying to use the latest release (2.5) on > Windows XP. > > What I want to do is execute a program and have the results of the > execution assigned to a variable. According to the documentation the way > to do this is as follows: > > import comm

Re: Trying to run an external program

2006-09-20 Thread Stephan Kuhagen
Brant Sears wrote: > Any ideas on what I might do to troubleshoot this? As other stated out, you are using the wrong module. Try: >>> import os >>> p=os.popen('dir') >>> for l in p: ... print l ... --- OUTPUT OF DIR HERE --- >>> p.close() The return value of close is the return value of the c

Re: Trying to run an external program

2006-09-20 Thread Matimus
Brant Sears wrote: > Hi. I'm new to Python and I am trying to use the latest release (2.5) > on Windows XP. > > What I want to do is execute a program and have the results of the > execution assigned to a variable. According to the documentation the > way to do this is as follows: > > import comman

Re: Trying to run an external program

2006-09-20 Thread Gabriel Genellina
At Wednesday 20/9/2006 19:49, Brant Sears wrote: Hi. I'm new to Python and I am trying to use the latest release (2.5) on Windows XP. What I want to do is execute a program and have the results of the execution assigned to a variable. According to the documentation the way to do this is as foll

Trying to run an external program

2006-09-20 Thread Brant Sears
Hi. I'm new to Python and I am trying to use the latest release (2.5) on Windows XP. What I want to do is execute a program and have the results of the execution assigned to a variable. According to the documentation the way to do this is as follows: import commands x = commands.getstatusou