Skip to content

Instantly share code, notes, and snippets.

@dreid
Last active December 19, 2015 13:28
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 dreid/5962166 to your computer and use it in GitHub Desktop.
Save dreid/5962166 to your computer and use it in GitHub Desktop.
from __future__ import print_function
import node
from twisted.internet.task import deferLater
@node.main
def main(reactor):
return deferLater(reactor, 3, print, 'Hello, World!')
import sys
import atexit
_main = lambda x: None
def main(f):
global _main
_main = f
def _do_react():
from twisted.internet.task import react
react(_main, sys.argv[1:])
atexit.register(_do_react)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment