How do you conver output of "popen('ls')" to a list?

Ben Wolfson wolfson at uchicago.edu
Wed Feb 20 19:48:55 EST 2002


On Wed, 20 Feb 2002 06:09:26 -0600, husam wrote:

> os.listdir('.') gets you all the files in the '.' dircetory. This want
> work if i want to process some selected files. In contrast to this,
> "os.popen() allows you to pass arguments like "ls *txt" to retrieve only
> *.txt files.

In that case, you may want to try glob.glob().

-- 
BTR    
BEN WOLFSON HAS RUINED ROCK MUSIC FOR A GENERATION
 -- Crgre Jvyyneq



More information about the Python-list mailing list