Running a windows command

Don Tuttle tuttledon at hotmail.com
Tue Jan 15 17:57:46 EST 2002


Try this:

import os
result = os.popen('foo c:\\someFile.txt')   # Double backslash
stuff = result.read()
print stuff

Don

"Stephen Boulet" <stephen.boulet at motorola.com> wrote in message
news:3C449BB6.EFDE700B at motorola.com...
> I have a command line program, foo.exe, that when run will dump some
> text to the dos shell. I've tried this:
>
> import os
>
> result = os.popen('foo c:\someFile.txt')
>
> But that doesn't work. How do I capture the text sent to the dos shell?
> Thanks.
>
> -- Stephen





More information about the Python-list mailing list