DelphiDelphiVCLLearn PythonPythonPython GUIWindows

An Introduction To DelphiVCL: A Python GUI Builder For Windows

photo of man smiling in front of his laptop

Sometimes your application needs a user interface with professional looks, but what is the best way to make one for Python applications? Try DelphiVCL for Python! 

DelphiVCL is a Python module giving Python GUI apps on Windows access to Delphi’s VCL for robust and high-performance native Windows visual widgets. It uses the Python4Delphi library as a bridge between Delphi’s VCL (Visual Component Library) and Python. DelphiVCL is currently available for Windows. 

The DelphiVCL Python module makes ‘the whole VCL’ available in Python! No Delphi or Object Pascal experience or knowledge is necessary for you as a Python developer to take full advantage of the Native GUI benefits.

 

How can we use DelphiVCL?

These are the steps for using the DelphiVCL:

1. Installing DelphiVCL

There are two ways for you to install DelphiVCL: By directly copying the module to your local/system path, or install it via pip.

1.1. Copy to Your Local or System Path

  • Download the DelphiVCL.pyd module Beta Release 0.01– Beta preview – 2021-18-01, and extract according to your Python version and bit. 
  • You will need to place the DelphiVCL.pyd to your default path for your Python packages/libraries. For example:

Or

if you use Anaconda Distributions.

1.2. Install via pip

  • Run easy-install by pip in your Command Prompt, using the following command:

(PIP installation is currently in the testing stage of development and will change in the near future. Check the DelphiVCL home page for more information.)

The installation progress in your Command Prompt:

1-9411561

 

2. Run a Simple Form Example

In essence, DelphiVCL is a wrapper that helps to create and access Delphi Objects quickly from Python. These wrappers contain container classes to extend and expose your custom events, methods, variables that can be used in Python script.

Here is a Python code sample using DelphiVCL to create a simple Form app with a list, edit, and button:

Here is the GUI created by the Python code above. You can run it using your favorite Python IDE, which for me is PyScripter:

1_3-7202040

Or you can save the script first, and run it through the command line using this command:

1_4-1117353

This GUI expects user inputs. Clicking the button will add the text from the edit box to the list box:

1_1-5028063

 

Conclusion

Congratulations, you already learn the powerful example of accessing Delphi’s VCL functionalities and features from Python, using DelphiVCL Modules.

Now it’s time for you to try it yourself, and please share your experiences in the comment section below.

Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.

Check out Python4Delphi which easily allows you to build Python GUIs for Windows using Delphi.

close
Related posts
DelphiDelphiVCLPythonPython GUIWindows

This Is The DelphiVCL.Application.Minimize Method

DelphiDelphiVCLPythonPython GUIWindows

Learn About DelphiVCL.Application.HandleMessage In Python

DelphiDelphiVCLPythonPython GUIWindows

What Is The GetParentComponent Method in DelphiVCL.Application?

DelphiDelphiVCLPythonPython GUIWindows

All You Need To Know About GetNamePath Method in DelphiVCL.Application

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

it_ITItalian