D
David Carroll
I'm at my wits end with this silly thing. I'm new to python, so please
excuse my impending ignorance . I am trying to execute a command, and
get the output back into a string variable. Here's what I think should
work from the docs I've read. The system I need to get this working on is
2000 professional, I'm posting this from my linux box, so please
don't look poorly upon me for the windows thing, it wasn't my choice.
import commands
#chop
status, output = commands.getstatusoutput("dir")
print "Output: ", output
print "Status: ", status
#chop
"""
returns:
C:\starNE>counter.py
Output: '{' is not recognized as an internal or external command,
operable program or batch file.
Status: 1
It returns that "'{' is not recogni..." with anything I pass as a command.
"""
os.system("dir")
works just fine, but I don't think I can capture the output, am I a victim
of a bug here?
Could it be related to this posting I googled?
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=506100&group_id=5470
Any suggestions would be greatly appreciated!
excuse my impending ignorance . I am trying to execute a command, and
get the output back into a string variable. Here's what I think should
work from the docs I've read. The system I need to get this working on is
2000 professional, I'm posting this from my linux box, so please
don't look poorly upon me for the windows thing, it wasn't my choice.
import commands
#chop
status, output = commands.getstatusoutput("dir")
print "Output: ", output
print "Status: ", status
#chop
"""
returns:
C:\starNE>counter.py
Output: '{' is not recognized as an internal or external command,
operable program or batch file.
Status: 1
It returns that "'{' is not recogni..." with anything I pass as a command.
"""
os.system("dir")
works just fine, but I don't think I can capture the output, am I a victim
of a bug here?
Could it be related to this posting I googled?
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=506100&group_id=5470
Any suggestions would be greatly appreciated!