Another newbie question

Phlip phlip_cpp at yahoo.com
Mon May 27 00:31:15 EDT 2002


SA wrote:

> I am trying to find a way to list the contents of a directory into a list
> so that the contents of the list are then read into an html doc as hrefs.
> 
> What I'm looking for is a way to ls a directory. Is there a way to access
> the shell command ls from within a python script and dumping the output
> into a list for further manipulation? Or does this have to be built from
> the ground up inside the python script?

os.path.walk does what you need, not what you want.

-- 
  Phlip
       http://www.greencheese.org/LucidScheming
  --  All analysis and no code makes Jack a dull boy.
      All analysis and no code makes Jack a dull boy.
      All analysis and no code makes Jack a dull boy.  --




More information about the Python-list mailing list