protecting the python code.

A.B., Khalid abkhd at
Mon Jan 17 15:02:58 EST 2005

nell wrote:
> Hi all,
> I've developed a testing application in python, and should supply it
> a way that no one (lets say they are regular users) will understand
> and edit it.
> The application source is all python but we expose a UI written in C#
> that go over all our code and expose to user functions (Indicated
> a special prefix).
> So the problem on one hand is protecting the source and make it less
> accessible ond on the other hand to make it available for the UI.
> 10x in advance

You basically have two options:

1. Use Pyrex to compile your application to be used as (a) module(s).
2. Use Pyrex to compile your application and embed Python in it.

The first option is probably the easier of the two, and it only
requires that you install Pyrex
( and that you
study the Docs and the Demos in their respective directories.

The second option is more involved but is still possible. You need to
follow this:

Many people use Pyrex to write Python extensions only. But given the
obvious absence of competitors to address the issue of the protecting
of python code, for whatever reason, then I think it is safe to say
that Pyrex is now in a unique position to address that issue as well.
Please be kindly reminded that even py2exe-- although a great
undertaking-- is not AFAIK currrently that protective of your code--
not that it ever claimed it is so-- as draging the resulting exe file
to your zip archiever will reveal the python code inside your exe file.
And so in short: try the Pyrex way.


More information about the Python-list mailing list