[Tutor] critique my script!

Alan Gauld alan.gauld at freenet.co.uk
Fri Aug 4 01:26:41 CEST 2006


> Under the LearningToProgram directory is a test
> directory that doesn't contain any .pyc files, so the
> script's returned value is correct.  However, .pyc
> files exist in the LearningToProgram directory, and I
> would like to put those files in the dictionary too. 
> Is there an elegant way to accomplish this?

You just need to apply glob at the root level before starting
to walk the tree. Because your inner loop looks at the dirs
list you only glob the subdirectories, you need to glob the 
top level one too.

Alan G.


More information about the Tutor mailing list