Skip to content

Instantly share code, notes, and snippets.

@chaobin
Created April 9, 2013 06:21
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 chaobin/5343372 to your computer and use it in GitHub Desktop.
Save chaobin/5343372 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import time
def coroutine():
try:
print "Executing"
seconds = (yield)
time.sleep(seconds)
except ValueError:
print "Reporting error"
finally:
print "Cleaning up"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment