How to use a timer in Python?

Nico Grubert nicogrubert at gmail.com
Fri Sep 23 10:07:18 CEST 2005


Hi Sybren and Wolfram,

thank you very much for the time.sleep() tip.
My program reads like this now.

import os
import time
WINDOWS_SHARE = 'C:\\Temp'
while 'transfer.lock' in os.listdir( WINDOWS_SHARE ):
     print "Busy, please wait..."
     time.sleep(10)

f = open(WINDOWS_SHARE + '/myfile', 'w')
f.write("test 123")
f.close()
print "Done!"


Nico



More information about the Python-list mailing list