[Video] wxFormBuilder: Build a Python Gif Viewer – 1

I have taught myself how to use wxFormBuilder to build Python GUI applications. As with anything related to python, there is information scattered all over the internet. It’s just a matter of searching, researching and testing various examples until you find the right code that suits your programming style.

In this tutorial I explain the procedures I have come up with that simplifies and speeds up the development of building Python GUI applications using wxPython widgets and the wxFormBuilder application

What wxFormBuilder Does and Doesn’t Do:

  • It provides a visual example of what the GUI will look like
  • It has property settings for MOST of the wxForm/wxPython widgets
  • The generated code that can be used for a python application is python or xrc code
  • It doesn’t generate all the necessary python code that you will need to run an application first up. You have to create this code yourself

Don’t worry, I will take you through the steps that will help you understand the use of wxPython widgets. You will then appreciate the value of the free open source wxFormBuilder application which will assist you in doing this.

Create Project Directories

To understand why you need to create more than one directory for a wxFormBuilder project, you need to understand the development process.

  1. When you start a project, wxFormBuilder creates its own project file
  2. You have to provide the path to your project directory for the python code that wxFormBuilder generates.
  3. The generated python code has some faults that inhibits its ability to be run by python. This means you have to clean the code add more code so it will run.

As you can see from the procedures above, there are three (3) steps required to build a python GUI using wxFormBuilder.

This means you will need three (3) directories:

Step Directory Name Reason
1 fb For wxFormBuilder project files
2 descode WxFormBuilder python generated code that needs to be decoded
3 src Sanitised python source code that is part of your final application.

If you have any questions or comments please post them on my YouTube video

Next Tutorial: [Video] wxFormBuilder: Build a Python Gif Viewer – 2