File list from listdir or shell?

Fredrik Lundh fredrik at pythonware.com
Thu May 26 13:49:50 EDT 2005


qwweeeit at yahoo.it wrote:

> Unluckily, to capture the stdout I have to redirect it to a file...
> I hoped that this could work ...
> lF=sys.stdin.readline(os.system("ls -1 *.py"))

hint: look up "os.popen" and "subprocess" in the library reference.

</F>






More information about the Python-list mailing list