os.popen() and dir command

nobody nobody at nowhere.near.here
Tue Feb 4 12:43:32 EST 2003


glob.glob() does not desced to subdirectories. os.path.walk() is slow...
"Gilles Lenfant" <glenfant at NOSPAM.bigfoot.com> wrote in message
news:b1ok3k$18av$1 at norfair.nerim.net...
> "nobody" <nobody at nowhere.near.here> a écrit dans le message de news:
> b1oj7g$j5q$1 at news7.svr.pol.co.uk...
> > The following code does not run properly on Windows XP
> > (it is supposed to get all zip file names):
> >
> > f =os.popen("dir /b /s w:\\*.zip")
> > p=f.readlines()
> >
> > The p will end up with a lot of nulls in it, it looks that os.popen() is
> > still broken.
> > Does anybody else have problem with os.popen() and dir command?
> >
> >
>
> Check the "glob" package in the standard Python distro for any platform.
> Whith this package, you don't need any "popen" to get a list of files that
> match a pattern.
>
> --Gilles
>
>
>






More information about the Python-list mailing list