Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # from original example
- with open('simple.py', 'r') as f:
- code = f.read()
- exec(code)
- # compile and run again
- a = compile(code, "simple_compiled_this_file_not_created", "exec")
- exec(a)
- # marshal and unmarshal
- import marshal
- f = open("./marshalfoo.bin", "wb")
- marshal.dump(a,f)
- f.close()
- b = marshal.load(open("./marshalfoo.bin", "rb"))
- exec(b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement