What is the difference between . py and . pyc files? [duplicate] pyc contain the compiled bytecode of Python source files The Python interpreter loads pyc files before py files, so if they're present, it can save some time by not having to re-compile the Python source code You can get rid of them if you want, but they don't cause problems, they're not big, and they may save some time when running programs
python - Where are the . pyc files? - Stack Overflow In Python < 3 2, the pyc files are placed in the same directory as the py file In Python 3 2, the compiled files are placed in a __pycache__ subdirectory, and are named differently depending on which Python interpreter created them
How do I open a compiled python file (. pyc) - Stack Overflow When we generate our compiled code of any python file that has a pyc extension, that is actually the bytecode of our code But if we try to open that bytecode, we cannot because our machine doesn’t have such software which supports that type or format of file
How to run a . pyc (compiled python) file? - Ask Ubuntu To complement this answer: a pyc file is not compiled in the strictest sense of the term, as it is not native machine code It is, as @tomdachi wrote, python-specific byte-code (very similar to a Java class), that's why it still needs the python interpreter to execture