Python – Stand Alone Application with GUI

Python has a built-in GUI package, which allows easy building of forms like this:

The package used in this example is tkinter. The form above takes the value, entered in the entry field, squares it and displays it back in the entry field, thus the square button can be clicked again. Quite a standard application.

The interesting part in this article is to make the application Stand Alone, and send it to someone, who does not have python installed and does not need to see the console. These are the 3 small steps needed, once the code is written:

  1. Save the python code as *.pyw
  2. Install “pip install pyinstaller”
  3. Generate the exe file with “pyinstaller -w InputOutputConsole.pyw”

Once these steps are ready, this is the result in the same folder:

In the dist folder, there is an EXE file, which can run the small application. The code of the application is here:

Enjoy it! Code is in GitHub as well.


A VBA Developer.

Tagged with: , , , ,