hide python code !

enigmadude enigmadude at rock.com
Thu Aug 10 20:35:27 EDT 2006


I don't think you're the first person that has wondered about this. But
you might have some options:

1. If you are running it on Windows only, use py2exe to wrap it up as
an executable.
2. I've never done this, but you might be able to encrypt or otherwise
turn you modules into binary form, and then use a clever import hook. I
know zipimport in the standard lib gives you more control over
importing zip files, but I don't think it can handle encrypted ones.
3. Write a custom module importer in C using Python's API so you can
encrypt your modules any way you want as long as you know how to use C
to decrypt them again.

There's probably a thousand other ways if you're clever enough (e.g.
write it in Jython and package it as .jar files). As long as your
program sticks closer to pure Python, the easier it will be. If you're
using a lot of open source modules to help you out, you might want to
double-check their licensing to see if what you're doing is allowed
anyway.


Bayazee wrote:
> hi
> can we hide a python code ?
> if i want to write a commercial software can i hide my source code from
> users access ?
> we can conver it to pyc but this file can decompiled ... so ...!!
> do you have any idea about this ...?
>
> ---------------------------------------
> First Iranian Open Source Community : www.python.ir




More information about the Python-list mailing list