Re: os.system and command output

2006-06-07 Thread Fredrik Lundh
A.M wrote: > Is there anyway I can get the exit code (what os.system returns) from > os.popen? you'd rather kill yourself than read the documentation, right? http://www.python.org/doc/lib/os-newstreams.html#os-newstreams "The exit status of the command (encoded in the format specifie

Re: os.system and command output

2006-06-07 Thread A.M
> Try: > > s = os.popen("DIR").read() > Thanks Steve. Is there anyway I can get the exit code (what os.system returns) from os.popen? -- http://mail.python.org/mailman/listinfo/python-list

Re: os.system and command output

2006-06-07 Thread Steve Holden
A.M wrote: > Hi, > > > > How can I run an OS command and have the command's output (to stdout) in my > string variable? > > > > For example in windows, this command should return a list of files within > directory: > > > > os.system("DIR") > > > > I am looking for an alternative funct

os.system and command output

2006-06-07 Thread A.M
Hi, How can I run an OS command and have the command's output (to stdout) in my string variable? For example in windows, this command should return a list of files within directory: os.system("DIR") I am looking for an alternative function that returns the DIR command output in a str