sxkorean at gmail.com
Sun Oct 28 18:01:24 CET 2007
On 10/28/07, Lawrence Shafer <detroit371 at gmail.com> wrote:
> Why doesn't this fill otp with the output of ls?? (I know python has
> it's own file tools, I'm just playing around ;)
> import os
> print otp
> Tutor maillist - Tutor at python.org
I actually had the same question a while back. I'm still a newbie, but the
advice I was given was to use popen(). ls = os.popen("ls").read() worked
for me. Also, for Unix style OSes, you can import commands, and then it has
Just my two cents.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor