[newbie] file object not returned by function?
rshaw2 at midsouth.rr.com
Mon Nov 3 16:26:34 CET 2003
> >while True:
> > minutes, seconds = localtime(), localtime()
> > if date != localtime(): # a new day has dawned, open a new logfile
> > logfile = make_logfile()
> > date = localtime()
Just an idea here, but you call "localtime" four times here when you
only need to call it once. Might something like this work?
day, hours, minutes, second = localtime()[2:6]
if date != day:
logfile = make_logfile()
date = day
More information about the Python-list