After compiling a in unix-working python file using
import py_compile
py_compile.compile(\'server.py\')
I get the .pyc file in the same directo
Compiling a python file does not produce an executable, unlike C. You have to interpret the compiled Python code with the Python interpreter.
$ python
>>> import py_compile
>>> py_compile.compile('server.py')
>>> ^D
$ python ./server.pyc
The only change compiled Python code has is that it takes slightly less time to load. The Python interpreter already compiles code when it is loaded, and that doesn't take very long at all.