Created
February 10, 2009 23:41
-
-
Save jeremyBanks/61694 to your computer and use it in GitHub Desktop.
[2010-01] i was testing out the multiprocessing module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.0 | |
import sys | |
import multiprocessing | |
def process(function, name=None): | |
"""Decorates a into spawning a new process. Yay clarity.""" | |
def decorated(*args, *kwargs): | |
p = multiprocessing.Process(target=function, name=name, args=args, kwargs=kwargs) | |
p.start() | |
return(p) | |
return(decorated) | |
def main(*args): | |
print("Hello, world!") | |
if __name__ == "__main__": sys.exit(main(*sys.argv[1:])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment