One Minute Python

The easiest one-page guide to start creating python applications with the minimum effort ... and using only open source software!

Introduction:

Start programming in python it is really easy. However it could even easier if we could create a simple graphical interface to test its power without bother with the console. With this tutorial you will have your first custom python graphical application running in less than one minute!

Step 1: Install Python

For our purposes, best Python version is 2.6. Download it from one of the following links:

Windows Installer, Windows AMD64 Installer, Mac Installer. Ubuntu users should have Python 2.6 preinstalled.

For more installer packages visit the official Python release page.

Step 2: Install wxPython

Install wxPython runtime. If you installed Python 2.6, you may want to download one of these installers:

Windows Installer, Windows 64 Installer, Mac Installer. Ubuntu users follow these instructions.

For more installing options visit the official wxPython download page.

Step 3: Install wxFormBuilder

Install wxFormBuilder version 3.1 or above. Note: there is currently no stable version, so for now you must install the beta version:

Windows Installer, Mac Installer (coming soon), Ubuntu package (coming soon).

For more info on wxFormBuilder visit its official page.

Step 4: Download the template application

Download and unzip this template application. You can already launch main.py contained inside and see the template application.



Step 5: Customize the graphical user interface

The gui can be customized with wxFormBuilder. It is very easy to understand how to place controls and to bind events handlers. Use the sample controls provided.


Step 6: Customize event handlers

Each control provides a set of predefined events. With wxFormBuilder it is easy to bind handlers (i.e. functions) to events:


Once you bind the handler save the project and generate code (F8). Then define the bound function in MainFrame.py:



That's it!

Did you actually spend one minute?