I am new to python and I have never compiled python code to an executable file before. The languages I am well familiar with are C, C++, and Java and I have never come across a language that lets you modify the code from within itself, like Python which uses has the method
a = 500
code = raw_input()
py2exe never compiles Python code into native executables; it bundles up a Python interpreter into an executable, always. This is likewise true of
cx_Freeze and every other tool offering similar functionality while supporting the full Python language rather than a limited subset thereof.
eval and similar constructs are available without needing additional facilities.