PYC Files

Peter Hansen peter at engcorp.com
Thu Dec 19 13:49:27 EST 2002


Newt wrote:
> 
> Quick couple of questions:
> 
> Are the .pyc files system independant?
> Can .pyc files be 'uncompiled' back to the original source code?
> When releasing software, is it normal to release the .py files, or .pyc
> files?
> Lastly, is there such a thing as a runtime environment (like with Visual
> Basic) that can be downloaded, or does the full release need to be
> downloaded?

The general direction of your questions seems to be towards ensuring
that end-users cannot reproduce the source once you deliver the program
to them.

The short answer to this is that with Python, it is not worth the effort
to try to prevent this except via licensing.  Choose the packaging method
based on other considerations, not based on source-protection.

If you must do this, the best approach currently might be to use Jython,
as it compiles to .class files which, I would guess, cannot easily be
reverse-engineered back to the Python source.  That wouldn't stop anyone
from "stealing" your stuff, however, one way or the other, so you still
need to spend time ensuring you have a proper license in place for the
users.

There are *many* frequent discussions along these lines in this newsgroup,
so please search the archives before asking for more background.  There
are probably no new answers...

-Peter



More information about the Python-list mailing list