File.write() not working in a sleepy loop

Christian Heimes lists at cheimes.de
Tue Feb 19 14:57:06 CET 2008


Gavin Lusby wrote:
>     ############################ write outfile ############################
>         o=open(os.getcwd()+g.dsep+file, 'w')
>         if g.verbose:
>             print '...writing to '+os.getcwd()+g.dsep+file
>         o.write('%over = (njobs => '+str(answer)+');\n')
>         o.close
>     ############################### sleep now #############################
>         sleep(refresh)

Try o.close() ;)

Christian




More information about the Python-list mailing list