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. 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. 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 demo.py and add the following code:

Execute the demo.py 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!

 

Conclusion

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.

close
Related posts
DelphiDelphiVCLLearn PythonPythonPython GUIWindows

Decipher the DelphiVCL.Application

DelphiDelphiVCLLearn PythonPythonPython GUIWindows

Create a Very Basic Empty Form using DelphiVCL.Form

DelphiDelphiVCLLearn PythonPythonPython GUIWindows

An Introduction To DelphiVCL: A Python GUI Builder For Windows

Learn PythonPythonPython GUI

Learn Python With Desktop GUI App With Python and Tkinter Video

Leave a Reply

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

en_USEnglish