queston with glob!!
Sean 'Shaleh' Perry
shaleh at valinux.com
Wed Apr 18 17:57:44 EDT 2001
>
> There files inside these directories which I want ot search and store
> recursively from the current diretory down deep to the lowest level of
> subdirectory.
> I use glob.glob(currentDir+os.sep+'*')
> But this can only get me the subdirectory not the files down. If I want down
> one more level, then I need to write this glob.glob(currentDir + os.sep +
> os.sep +'*')
> which is not a good approach as it is too rigid.
>
> How can I modify the code to search down to the deepest level?
>
look at the docs for os.path, specifically walk().
More information about the Python-list
mailing list