Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Introduction to Python GUI Development with Delphi for Python (VCL & FMX)

delphipythonfeaturedimage

Learn how Embarcadero’s newly released free Python GUI modules bring the power and flexibility of Delphi’s GUI frameworks to Python. VCL and FireMonkey (FMX) are mature GUI libraries. VCL is focused on native Windows development, while FireMonkey brings a powerful flexible GUI framework to Windows, Linux, macOS, and even Android. This webinar will introduce you to these new free Python modules and how you can use them to build graphical users interfaces with Python. Part 2 will show you how to target Android GUI applications with Python!

Slides download as PDF

Target Audience

It’s not a Competition

● Developers have multiple tools on their workbench
● It is about finding the right tool for each task
● Having specialized tools for different tasks doesn’t detract from favorite tools
● You can always find a specific task that another tool is better for, but no one tool is that best for all tasks.

What is Delphi for Python?

● Set of free Python modules bringing Delphi’s GUI libraries to Python developers
● Based on the open source Python4Delphi (same technology that powers PyScripter)
● Available today on GitHub & PyPi
● Currently in beta, but ready for use
● DelphiVCL for Python supports Windows (32-bit & 64-bit)
● DelphiFMX for Python adds support for Linux 64-bit, Android, & Mac OS
● Part of a bidirectional bridge between Delphi and Python

Timeline for Delphi & Python

Delphi’s DNA

  1. Developer productivity – Really the main goal is getting things done quickly
  2. Maintainability – Code is easy to read and understand with good encapsulation
  3. Fast compiled native apps – Compiles fast, and native applications run fast
  4. Database access – Always includes a rich set of database access components
  5. Platform API access – You don’t need to call platform APIs, but can if you want
  6. Property-Method-Event – General model for working with components
  7. Visual designers – WYSIWYG with drag and drop interface
  8. Reliable applications – Exception handling and component owner model
  9. Backwards compatibility – Even with all the updates most code is compatible
  10. 10.Rich component ecosystem – There is usually a component for everything

Zen of Python

19 “guiding principles” that influence the design of the Python programming language

Comparison (Delphi – Python)

Three Levels of Development (Universal to all development tools)

VCL (Visual Component Library for Microsoft Windows)

● Designed for Windows and evolving with each new Windows release supporting latest features, controls, themes, and design
● Full source ships with each release since Delphi 1
● Mostly a light wrapper around the native platform widgets and controls
● Includes a lot of “owner drawn” controls too
● Provides easy access to Windows Handles, Messages, etc.
● Greatly simplifies Windows development maintaining access to all platform features and APIs
● Native Windows look and feel with full theme system
● Mature platform with rich ecosystem of 3rd party components

FMX (The Cross-Platform FireMonkey Framework)

● Takes advantage of GPU libraries to provide a hardware accelerated, rich user interface that is fast and looks great across multiple platforms
● Similar to VCL, but not designed to be compatible
● Integrated GPU effects, animations, and robust styling system
● Platform services abstract the access to platform hardware and functionality to intelligently adapt the UI & UX to platform specifics
● Very flexible component system – do more with fewer components (nestable)

Short Delphi Tour

Delphi for Python

Delphi VCL for Python Installation

Hello World (The simplest example)

Example with Styles

Design Your UI in the Delphi IDE

Combine Delphi and Python

Use Delphi to Create Native Python Modules

● Many Python modules are written in C/C++ and natively compiled
● Delphi also creates natively compiled Python modules via Python4Delphi
● Prototype rapidly in Python, and then create optimized modules in Delphi to clear bottlenecks
● Much like Python, Delphi code is focused on readability and clear structure and may be easier for you than using C/C++
● Augment your use of PyPy or Cython

Documentation and Library References

About PyScripter

About UltraEdit

Next Steps

Find Delphi VCL for Python on GitHub

Exit mobile version