Tools: Nuitka, Easygui, Pip, Ubuntu 14.04
Here's the easiest and fastest way I've found to start coding a python GUI on Ubuntu and how to compile it to a executable. That way anyone can run it without seeing your source-code and without needing to install python or the extra modules.
At the moment Nuitka, the python compiler I use, hasn't quite finished cross-platform portablity, so these will only work on Linux. The website says the "--target-windows" flag is "not yet working fully correctly due to the DLL hell problem with the C runtime" however they "hope to get this right in subsequent releases." Anyway, here we go.
1. first install NuitkaCODENAME=`lsb_release -c -s` wget -O - http://nuitka.net/deb/archive.key.gpg | apt-key add - echo >/etc/apt/sources.list.d/nuitka.list \ "deb http://nuitka.net/deb/stable/$CODENAME $CODENAME main" apt-get update apt-get install nuitka2. install python module easygui
if you don't have pip, you can install it with the following code:
sudo apt-get install pipthen get easygui like so
sudo pip install easygui3. create a python file
gedit "hello_msgbox.py"4. write a hello world program using easygui
from easygui import msgbox msgbox("Hello world!", title="My message box")4. convert it to an executable using nuitka
nuitka --recurse-all --exe hello_msgbox.py5. run the executable
./hello_msgbox.exe
Lo and behold, you're done. Now go build something!
And if you're just here for the code, I've been there too so here's everything together.CODENAME=`lsb_release -c -s` wget -O - http://nuitka.net/deb/archive.key.gpg | apt-key add - echo >/etc/apt/sources.list.d/nuitka.list \ "deb http://nuitka.net/deb/stable/$CODENAME $CODENAME main" apt-get update apt-get install nuitka sudo pip install easygui echo 'from easygui import msgbox' >> hello_msgbox.py echo 'msgbox("Hello world!", title="My message box")' >> hello_msgbox.py nuitka --recurse-all --exe hello_msgbox.py ./hello_msgbox.exe