Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deploy a Python desktop application?

I have started on a personal python application that runs on the desktop. I am using wxPython as a GUI toolkit. Should there be a demand for this type of application, I would possibly like to commercialize it.

I have no knowledge of deploying "real-life" Python applications, though I have used py2exe in the past with varied success. How would I obfuscate the code? Can I somehow deploy only the bytecode?

An ideal solution would not jeopardize my intellectual property (source code), would not require a direct installation of Python (though I'm sure it will need to have some embedded interpreter), and would be cross-platform (Windows, Mac, and Linux). Does anyone know of any tools or resources in this area?

Thanks.

like image 911
mmattax Avatar asked Oct 02 '08 19:10

mmattax


People also ask

How do you create a desktop application in Python?

How to create a desktop application in Python? To create a desktop application, you need to learn the basics of Python, object-oriented programming, and the fundamentals of the Tkinter library. Tkinter is a GUI (Graphical User Interface) library of Python, which can help you create desktop apps easily.


1 Answers

You can distribute the compiled Python bytecode (.pyc files) instead of the source. You can't prevent decompilation in Python (or any other language, really). You could use an obfuscator like pyobfuscate to make it more annoying for competitors to decipher your decompiled source.

As Alex Martelli says in this thread, if you want to keep your code a secret, you shouldn't run it on other people's machines.

IIRC, the last time I used cx_Freeze it created a DLL for Windows that removed the necessity for a native Python installation. This is at least worth checking out.

like image 136
cdleary Avatar answered Oct 04 '22 02:10

cdleary