Are you an expert in desktop apps and GUI development who want to also work with Python because of its simplicity, flexible use, and growing demand in the market out there? Or are you a Python Developer at any level who wants to start a GUI development journey? This article is for you.
We will review the two examples of the most powerful Python Desktop App and GUI Frameworks: Python For Delphi (P4D) VCL vs Python GUI Generator: PAGE.
Table of Contents
1. Python For Delphi VCL
How about combining the strength of GUI and desktop app development by Delphi with Python for your applications, to provide first-class solutions for your customer needs? Python4Delphi is the answer to your need!
Python for Delphi (P4D) is a set of free components that wrap up the Python DLL into Delphi and Lazarus (FPC). They let you easily execute Python scripts, and powerfully create new Python modules and new Python types.
The best advantage of P4D is, it makes it very easy to use Python as a scripting language for Delphi applications that comes with a very extensive range of customizable demos and tutorials that ready to use to develop real-world apps. In shorts: P4D gives you various real-world “Hello World!” apps that ready to adjust to your needs!
Prerequisites: Before you begin to work with Python4Delphi VCL, download and install the latest Python for your platform. Follow the Python4Delphi installation instructions mentioned here. Alternatively, you can check out the easy instructions found in this video Getting started with Python4Delphi and the behind the scene details of how Delphi manages to run your Python code in this amazing Python GUI can be found at this link.
Here are some working example of it, runs on RAD Studio:
Let’s try this interesting Demo, Demo29: Using Python Imaging Library (PIL) to read image and perform Image Processing:
And let’s try another interesting Demo, Demo17: Using variant arrays of 2 dimensions:
2. Python GUI Generator: PAGE
PAGE is a drag-and-drop GUI generator for Python and Tkinter which generates Python modules that display a relatively simple GUI constructed from Tk and ttk widget sets using the Place Geometry Manager. PAGE is a cross-platform tool running on any OS which has a current version of Python installed. PAGE output requires only Python Tkinter and runs on Linux, Unix, Windows, OS X, and even Rasperian.
PAGE is a cross-platform drag-and-drop GUI generator, bearing a resemblance to Visual Basic. PAGE is written in Tcl/Tk 8.6 which is embedded in tkinter. PAGE springs from Virtual Tcl, forked to generate Python modules that realize the desired GUI.
PAGE is not an end-all, be-all tool, but rather one that attempts to ease the burden on the Python programmer. It is aimed at the user who will put up with a less than completely general GUI capability to get an easily generated GUI. A helper and learning tool, it does not build an entire application but rather is aimed at building a single GUI class and the boilerplate code in Python necessary for getting the GUI on the screen.
How can we use Python GUI Generator: PAGE?
The steps for using the Python GUI Generator: PAGE, are:
- Download the installer here.
- Run the installer.
3. Initializing and Executing PAGE
We can easily initialize page from command prompt. First, go to the path where you installed the PAGE (for me, it’s C:page), and run this command:
1 |
python page.py |
After that, these windows will be initialized:
4. Run the Built-In Examples
Let’s try the Calendar GUI example by navigating to C:pageexamplescalendar, and run this command:
1 |
python cal_support.py |
This Calendar GUI will show up:
Conclusion
Congratulations, you already learn the amazing example of GUI development by Python4Delphi vs Python GUI Generator: PAGE!
Now it’s time for you to try it yourself, and please comment below for which one is your favorite that best suits your needs!
Check out Python4Delphi which easily allows you to build Python GUIs for Windows using Delphi.