File.write() not working in a sleepy loop

Christian Heimes lists at cheimes.de
Tue Feb 19 08:57:06 EST 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