Ask for a tool to protect my .pyc file :)

Delaney, Timothy C (Timothy) tdelaney at avaya.com
Sun May 8 19:15:16 EDT 2005


Lily Kakm wrote:

> when I distribute my software, I will give the users .pyc file (maybe
> I can use py2exe, but I think there's no essential different),
> because I don't like them to know my source code.

Leaving aside all other arguments of whether or not you should allow
your users to see your source code ...

The simplest method to compile python is to use Pyrex:
http://www.google.com.au/search?q=pyrex&btnI

It's almost-compatible syntax-wise with Python 2.2 (no augmented
assignment, no nesting classes, and classmethods don't appear to work -
probably static methods too).

Then you just have a single script which calls your first main module,
and everything else is in a shared library (.so, .pyd).

It's quite nice to be able to have identical source, copy the source
tree, rename files appropriately and be able to build using Pyrex (with
an appropriate setup.py).

Tim Delaney



More information about the Python-list mailing list