Home » Coding » Python » Re: Problem using subprocess.Popen on windows
Re: Problem using subprocess.Popen on windows [message #17451] Sun, 07 October 2007 20:43
Nicholas Bastin  is currently offline Nicholas Bastin
Messages: 7
Registered: October 2007
Junior Member
On 10/7/07, jorma kala <jjkk73@gmail.com> wrote:
> from subprocess import *
>
> p1 = Popen(["dir"], stdout=PIPE)
> output = p1.communicate()[0]
>
>
> But I get a WindowsError : [Error 2] File Not Found

Tim answered your actual question, but why are you doing this in the
first place? The Python standard library provides all the
functionality that dir will provide and you don't have to parse the
output...

Look into <http://www.python.org/doc/lib/os-file-dir.html>, and
specifically, os.listdir(path).

--
Nick
Previous Topic:supplying password to subprocess.call('rsync ...'), os.system('rsync ...')
Next Topic:a good website for softwares,movies and music etc.
Goto Forum:
  


Current Time: Fri May 16 02:45:52 EDT 2008

Total time taken to generate the page: 5.28523 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software