How do I deploy a Python desktop application?

前端 未结 5 1587
粉色の甜心
粉色の甜心 2021-01-30 03:40

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 po

相关标签:
5条回答
  • 2021-01-30 03:49

    I have been using py2exe with good success on Windows. The code needs to be modified a bit so that the code analysis picks up all modules needed, but apart from that, it works.

    As for Linux, there are several important distribution formats:

    • DEB (Debian, Ubuntu and other derivatives)
    • RPM (RedHat, Fedora, openSuSE)

    DEBs aren't particularly difficult to make, especially when you're already using distutils/setuptools. Some hints are given in the policy document, examples for packaging Python applications can be found in the repository.

    I don't have any experience with RPM, but I'm sure there are enough examples to be found.

    0 讨论(0)
  • 2021-01-30 03:52

    Wow, there are a lot of questions in there:

    • It is possible to run the bytecode (.pyc) file directly from the Python interpreter, but I haven't seen any bytecode obfuscation tools available.

    • I'm not aware of any "all in one" deployment solution, but:

      • For Windows you could use NSIS(http://nsis.sourceforge.net/Main_Page). The problem here is that while OSX/*nix comes with python, Windows doesn't. If you're not willing to build a binary with py2exe, I'm not sure what the licensing issues would be surrounding distribution of the Python runtime environment (not to mention the technical ones).

      • You could package up the OS X distribution using the "bundle" format, and *NIX has it's own conventions for installing software-- typically a "make install" script.

    Hope that was helpful.

    0 讨论(0)
  • 2021-01-30 03:53

    Try to use scraZ obfuscator (http://scraZ.me). This is obfuscator for bytecode, not for source code. Free version have good, but not perfect obfuscation methods. PRO version have very very strong protection for bytecode. (after bytecode obfuscation a decompilation is impossible)

    0 讨论(0)
  • 2021-01-30 04:02

    Maybe IronPython can provide something for you? I bet those .exe/.dll-files can be pretty locked down. Not sure how such features work on mono, thus no idea how this works on Linux/OS X...

    0 讨论(0)
  • 2021-01-30 04:10

    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.

    0 讨论(0)
提交回复
热议问题