How to use a timer in Python?

Paul Rubin http
Fri Sep 23 10:20:46 CEST 2005


Nico Grubert <nicogrubert at gmail.com> writes:
> while 'transfer.lock' in os.listdir( WINDOWS_SHARE ):
>      print "Busy, please wait..."
>      time.sleep(10)
> 
> f = open(WINDOWS_SHARE + '/myfile', 'w')

But there's a race condition, and don't you have to make your own lock
before writing myfile, so that the cron job won't clobber it or miss it?



More information about the Python-list mailing list