Skip to content

Instantly share code, notes, and snippets.

@berinhard
Created August 9, 2010 19:42
Show Gist options
  • Select an option

  • Save berinhard/515969 to your computer and use it in GitHub Desktop.

Select an option

Save berinhard/515969 to your computer and use it in GitHub Desktop.
A short decorator used to clean main loop functions. I use it in my pygame projects.
def main_loop(f):
def func():
while True:
f()
return func
@main_loop
def main_loop_function():
print "Whoooo! I'm in loop!"
main_loop_function()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment