Distributing Python Apps for Windows Desktops
I’ve started working on a blog post about how to create a Python app auto-update and it turned into three. After these 3 articles, you will be able to create a Python app that fully works on windows and you can distribute it within an installer.
This text was originally written in Portuguese.
- How to create a Python .exe with MSI Installer and Cx_freeze
- How to create an application with auto-update using Python and Esky
- How to create an MSI installer using Inno Setup
It has just 4 Steps:
- Create a simple project called boneca
- Build an MSI installer using Cx_freeze
- Add an Auto-update feature to the project, using Esky
- Show how to use Inno Setup to build a more powerful and custom installer
In the end will be able to pack and distribute Python apps for windows desktop in an easy way.
Some people still think Python is just a script language or it works only for web development through frameworks, but it’s not. It can be compiled and it can be shipped without source code, turned into a commercial application.
The great example of all time is Dropbox. Dropbox client was written in Python to be portable for Windows, Mac, and Linux. The only difference is the interface. For Windows and Linux, Dropbox uses wxPython and for Mac it uses Python-ObjC. I like this words from Guido Van Rossum about Dropbox:
“Python plays an important role in Dropbox’s success: the Dropbox client, which runs on Windows, Mac and Linux (!), is written in Python. This is key to the portability: everything except the UI is cross-platform. (The UI uses a Python-ObjC bridge on Mac, and wxPython on the other platforms.) Performance has never been a problem — understanding that a small number of critical pieces were written in C, including a custom memory allocator used for a certain type of objects whose pattern of allocation involves allocating 100,000s of them and then releasing all but a few. Before you jump in to open up the Dropbox distro and learn all about how it works, beware that the source code is not included and the bytecode is obfuscated. Drew’s no fool. And he laughs at the poor competitors who are using Java.”
Originally published at Fernando Alves.