Skip to content

Instantly share code, notes, and snippets.

@slashmili
Created March 16, 2012 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slashmili/2050211 to your computer and use it in GitHub Desktop.
Save slashmili/2050211 to your computer and use it in GitHub Desktop.
Milad's Dream
import dream
import time
import threading
class Milad ( threading.Thread ):
def run ( self ):
try :
#don't fear ! if you want wake up just want
#after that time.Wakeup exception will be happen
time.sleep(dream.ONE_YEAR)
except dream.StartStory story:
f=open("~/dreams.txt")
f.write("%s\n"%(story))
f.close()
self.run()
except time.Wakeup :
pass
Milad().start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment