While trying to use Python\'s \"exec\" statement, I got the following error:
TypeError: exec: arg 1 must be a string, file, or code object
I do
There is an excellent blog post by Dan Crosta explaining this topic, including how to create code objects manually, and how to disassemble them again:
Exploring Python Code Objects