I am working on an interesting tool which I feel has good value and may eventually want to open source it. However, till I decide, I want to keep it "closed".
The problem is I want to code it in Python and this inherently means shipping the code. I know I can convert Python code into a binary but I want something which works across Windows / Linux / Mac
Can someone please point me to how this can be done?
-
f you code a script in some scripting language, you have to ship that source code script (which you could obfuscate). Otherwise, use some "compiled" language (perhaps compiled to bytecode like Java or Ocaml) and ship the (bytecode) compiled form. If you want to open source it, do that early, to get more bug reports and patches as soon as possible.Basile Starynkevitch– Basile Starynkevitch2012年08月23日 10:05:58 +00:00Commented Aug 23, 2012 at 10:05
-
See also: How do I protect python code?Janne Karila– Janne Karila2012年08月23日 10:20:17 +00:00Commented Aug 23, 2012 at 10:20
1 Answer 1
Well, Python is a scripting language, so it's not quite possible to create real .exe file.
However, you might want to compile your code to .pyc and then distribute your application. Running .pyc is the same as regular python file:
$ python code.pyc
compileall - http://docs.python.org/library/compileall.html#module-compileall
Typical usage:
python -m compileall ./
I am not sure about decompilation issues, but I assume it's possible. Java .class files can be decompiled as well.
Comments
Explore related questions
See similar questions with these tags.