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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top