.pyc files are python files compiled into byte code by the interpreter. They are generated normally when the file is imported.
.pyo is compiled byte code without line numbers, statements, and some other things (possibly document lines) for optimization purposes.
when calling the python interpreter, you can pass the -O or -OO to create the .pyo file. Using -O throw out line numbers, statements, and some debugging information. -OO will cause the -OO file .pyo also have no docstrings.
source share