compiling python program

A

Al

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?

thanks in advance!!
Al (newbie!!)
 
C

Camilo Olarte

In a python-src distribution look for a tool called Freeze.py
you can download it from sourceforge too..
You can also pack it with an utility you can find at :

http://sebsauvage.net/python/
called pypack.py
which encrypts the content of your py file but lets it yet runnable(Woa!!!)
this is disencryptable ... but , to a non-python person its somewhat hard to.

Camilo Olarte
 
E

Erik Max Francis

Al said:
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.
 
M

Mark 'Kamikaze' Hughes

Erik Max Francis said:
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.
 

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,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top