[Tutor] critique my script!
Python
python at venix.com
Fri Aug 4 01:56:48 CEST 2006
On Fri, 2006-08-04 at 00:26 +0100, Alan Gauld wrote:
> > 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.
Which of course is all I suggested except with more shuffling than
necessary.
>
> Alan G.
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
--
Lloyd Kvam
Venix Corp
More information about the Tutor
mailing list