Created
April 12, 2012 22:30
-
-
Save deadbits/2371466 to your computer and use it in GitHub Desktop.
and again...
This file contains 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
import marshal | |
script = """ | |
print 'hello' | |
""" | |
code = compile(script, "<script>", "exec") | |
data = marshal.dumps(code) | |
# intermediate format | |
print type(data), len(data) | |
print "-"*50 | |
print repr(data) | |
print "-"*50 | |
exec marshal.loads(data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment