[Tutor] Hotfolder 1st attempt
Wed, 08 Nov 2000 10:11:36 -0500
Daniel Yoo wrote:
> On Mon, 6 Nov 2000, Scott Ralph wrote:
> > from time import *
> > from stat import *
> The only thing I could point out is that you might not want to import
> everything within time or stat. You can be more specific, like:
> from time import sleep
> It's considered good practice to pull out only the functionality that you
> need from modules; that way, people can see exactly which functions you're
> using from other modules.
> Another related reason is to avoid wacky problems with name conflicts: if
> either the 'time' or 'stat' modules had shared the same function names,
> one would have taken precedence over the other, which is tricky to detect.
> Otherwise, from a quick look, I think that your program looks good. You
> might want to un-hardcode '20' from your code, and make it a parameter of
> I'm taking a local look into the statements now.
> *** time passes ***
> I'm not quite sure what:
> > S_ISREG(mode)
> is doing; according to the documentation:
> """S_ISREG (mode)
> Return non-zero if the mode is from a regular file."""
> which means that it doesn't affect anything --- it only returns a true or
> false value. It looks mysterious, so you might want to check that
> Hope this helps!
> Tutor maillist - Tutor@python.org
Thanks for the feedback, I removed the S_ISREG(mode) I didn't need it. Does
your first suggestion also speed things up? from time import sleep. Thanks
again for the feedback.