By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,941 Members | 1,753 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,941 IT Pros & Developers. It's quick & easy.

Where do .pyc files come from?

P: n/a
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,

Sep 9 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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)

Sep 9 '05 #2

P: n/a
Ernesto wrote:
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,


http://www.python.org/doc/2.4.1/tut/...00000000000000

</F>

Sep 9 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.