DelphiIDELearn PythonPythonPython GUIRAD StudioWindows

Tutorial: Python For Delphi VCL vs Pyforms GUI

photo of man smiling in front of his laptop

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 Pyforms GUI.

1. What is 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:

0 rundemo1 3785324
Demo01 to Run any Python Scripts on Delphi

Let’s try this interesting Demo, Demo31: Using WrapDelphi to access Delphi Form attributes. This demo shows you various attributes in the Delphi VCL Form:

1 1 3053909
Expect User Input and Add Them to Lists
1 2 7295904
Expect User to Click Button and Go to the Next Page
1 3 6288770
Go Back to the First Page if the Button Clicked
1 4 7732600
This New Window will Show if You Close the First Page
1 5 7943716
This List and Check Box Demo will Show Up if You Close the Previous Window
1 6 1704623
The Document Browser Will Show Up after You Closed the Previous Window


2. What is Pyforms GUI?

Pyforms GUI is part of the Pyforms framework. Pyforms GUI is a Python 3 framework to allow pyforms applications to execute in Windows GUI mode.

This framework aims to boost the development productivity by providing an API in Python to allow the execution of applications developed for GUI and Web mode in terminal mode.

Pyforms GUI developed by Ricardo Ribeiro from Champalimaud Scientific Software Platform.

How can we use Pyforms GUI?

The steps for using the GUI package Pyforms are:

  1. Install Pyforms using pip or easy install (note: it will very much easier to install in Anaconda Distributions, because Pyforms GUI will require OpenCV, and other Data Science/Machine Learning packages that have higher compatibility with Anaconda Distributions):

See the installation progress in your command prompt:

2 1 8052186


2. Create your first app.

Create the file and add the following code:

Execute the file in the command prompt, using this command:

Let’s see the interesting results:

2 2 5597113

This GUI can even run a video inside it!



Congratulations, you already learn the amazing example of GUI development by Python4Delphi vs Pyforms GUI!

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.

Related posts
CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And NumPy Library?


Unlock the Power of Python for Deep Learning with Generative Adversarial Networks (GANs) - The Engine behind DALL-E

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And Matplotlib Library?

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And Pillow Library?

Leave a Reply

Your email address will not be published. Required fields are marked *