Where do .pyc files come from?

E

Ernesto

I noticed in a python distribution there were 5 python files (.py) and
5 other files with the same name, but with the extension .pyc . Is
this some kind of compiled version of the .py files. Thanks,
 
T

tooper

Yes, these are bytecode files.
If you run "python -o", you should also get .pyo files for optimized
bytecode. As long as you do not modify the source code, python directly
reuse the bytecode (that's also a way to distribute script without
source code to avoid your users fiddling in thecode and make it not
work properly - even if any advanced user will know how to revert back
to source code)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,046
Latest member
Gavizuho

Latest Threads

Top