Site icon Python GUI

Quickly Build Ultra-Modern Python Native Windows GUIs With Delphi

pythongui

Sometimes your application needs a user interface, but what is the best way to make one for Python applications? Enter DelphiVCL for Python. The VCL is a mature Windows native GUI framework with a huge library of included visual components and a robust collection of 3rd party components. It is the premier framework for native Windows applications, but how to use it with Python? Thanks to the DelphiVCL Python package (based on the open-source Python4Delphi library), the VCL is a first-class package for building native Windows GUIs with Python. Need more design tools? You can build the entire GUI in Delphi and then write all the logic in Python. 

Why Native GUI is Important:

Popular Python GUI Frameworks

Tkinter (TK Interface) –  The default Python GUI Available under the Python license, uses Tcl/Tk cross-platform widgets. Tk is implemented in C and some Tcl. Supports various styles but No OS style integration. Tkinter sample,

[crayon-6606a2b1d7c44645509184/]
<strong>Tkinter Form<strong>

PyQt (pie-cute) – Binding for the cross-platform Qt widget library. Originally by Trolltech (1991) and Nokia (2008). Qt is a set of C++ libraries and development tools that includes Cross-platform abstractions for GUI, Networking, threads, regular expressions, SVG, OpenGL,3D animation, etc. PyQT implements over 1000 of these classes as a set of Python Modules.

[crayon-6606a2b1d7c4d739653972/]
<strong>PyQT5 Form<strong>

Other Python GUI Frameworks.

Delphi & VCL

Python4Delphi & Embarcadero Delphi

DelphiVCL For Python

How to Build DelphiVCL for Python

  1. Check the video for how to extend Delphi Objects as a Python Extension module Combining the strengths of Delphi and Python – Python4Delphi replay part 2 from 46.03 minutes.
  2. Alternatively, we can check the blog post, How to extend PythonModule as a DLL using Python4Delphi. In a similar fashion, a simple Python Module DelphiVCL is created which wraps all the Delphi VCL objects.

Note: For Python developers, it’s less important how to build this DelphiVCL Python Extension Module, rather can learn on available VCL objects and their properties to quickly develop a GUI application. Similar to the Tkinter and PyQt sample app mentioned above, the DelphiVCL sample app is below.

[crayon-6606a2b1d7c4f594708080/]
<strong>DelphiVCL Form<strong>

Comparing the Forms of different Frameworks.

Styling :

OS integration’s :

Apart from these Delphi VCL uses Uses Windows controls and each control has a handle that supports UI testing. None provide native Windows controls or Windows platform integration.

How to run a DelphiVCL sample.

  1. Download DelphiVCL.7z and extract according to the python version. Where the DelphiVCL.pyd and the sample TestVCL.py found in the extracted folder.
  2. From the command prompt, navigate to the folder mentioned in step 1. Provide the Pythopn.exe path space DelphiVCL python script. Press the Enter key. e.g) C:DelphiVCLDelphiVCL.64bit-39>C:PythonPython39python.Exe TestVCL.py
  3. For more VCL components demonstration Download the Delphi4Python.zip folder and extract it. Run the samples Delphi4PythonSample.py and Delphi4PythonComponentsSample.py similar to step 2. Note. This Delphi4Python.pyd is built with Python39.dll

VCL Visual Designers

With the help of VCL Visual Designers, you can easily develop GUI quickly which later can be wrapped using Python4Delphi and extended as Python Module similar to DelphiVCL. Download the DelphiVCLWebinar.zip folder where you can learn how to wrap custom VCL forms using RAD studio. Note. This is built with Python39.dll and using Rad Studio 10.4.1

References

Delphi VCL DockWiki’s 

Python4Delphi Resources:

Blog Resources:

YouTube Embarcadero channel link:

Python4Delphi

Downloads

Summary

Exit mobile version