compiling python program

Mark 'Kamikaze' Hughes kamikaze at kuoi.asui.uidaho.edu
Mon Sep 29 08:12:33 EDT 2003


Erik Max Francis <max at alcyone.com>
wrote on Tue, 23 Sep 2003 01:33:07 -0700:
> Al wrote:
>> I'd like to "hide" my code from being viewed (linux). Is there anyway
>> for me
>> to compile my program into .pyc and only have the .pyc files
>> available, or
>> do I always have to have the .py file?
> You can just provide the .pyc file to clients.  But it will only be
> runnable by the same version of Python you used to compile it.

  I did that with the pre-open-source version of Umbra, and it worked
fine until Python got a new version; even then, it was just a matter of
recompiling it for 2.2 and replacing the zip, on the premise that anyone
who was going to run it would have the latest Python.

  If you have to, you can bundle Python with your program, and even use
py2exe to make a Windoze distribution.  MacOS X and Linux normally have
Python installed, so they don't need as much handholding as Windoze
users.

-- 
 <a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"I believe in communication.  If I communicate with you every so often, you'll
 be bothered by what I say enough that you won't ask me to, which means more
 sleep for me." -Something Positive, 2003Sep22




More information about the Python-list mailing list