
Daemon thread
By: a guest on
Aug 14th, 2012 | syntax:
Python | size: 0.38 KB | hits: 22 | expires: Never
#!/usr/bin/python
import threading
import time
class Update(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
while True:
with open('/tmp/log.txt', 'w') as f:
f.write('%d\n' % time.time())
time.sleep(1.0)
continous = Update()
continous.daemon = True
continous.start()