output of shell command
Sheila King
sheila at spamcop.net
Mon Feb 26 09:51:47 EST 2001
On Mon, 26 Feb 2001 04:38:58 -0800, "Emile van Sebille" <emile at fenx.com> wrote
in comp.lang.python in article <97diqu$nq7ks$1 at ID-11957.news.dfncis.de>:
:This works on my linux box and as Joe was looking for
:'ls -l', I assume it'll work for him too.
:
:But as I hadn't used the commands module before, I tried it
:on both my Win95 and Win2k boxes, where it failed to get the
:right info. So, either I'm doing it wrong, or the
:combination of commands and windows is broken, which I
:suspect.
:
:However, a=os.popen("dir").readlines() works on windows and
:linux. So if you're writing cross-platform, you'll want to
:keep this in mind.
Thanks for the tip. I didn't even try it out on Windows, since he was clearly
asking about a *nix type command.
I am looking to write cross-platform. One (of the many) reasons I'm enchanted
with Python.
--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/
More information about the Python-list
mailing list