This is the way to compile a Python file to a byte code file. The byte code file is not easy to read, check it out with an editor.
# create a byte code compiled python file
import py_compile
py_compile.compile("MyFile.py") # creates MyFile.pyc Python will run either the .py file or the .pyc file
The thing with the .py_ doesn't make much sense. If you take a source file like MyFile.py and rename it MyFile.py_ then you still have a source file. A byte code file like MyFile.pyc can be renamed to MyFile.py_, but it is still a byte code file!