SlideShare a Scribd company logo
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Jim McKeeth
Chief Developer Advocate
Embarcadero Technologies
jim.mckeeth@embarcadero.com
@JimMcKeeth
Slides, links & replay: blogs.embarcadero.com/?p=128183
Introduction to
Python GUI
Development
with
Delphi for Python
Part 1: Delphi VCL for Python
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Agenda
• Introduction to Delphi VCL & FMX
• Architecture and platforms
• Installing and using Delphi VCL for Python
• Demonstrations & Code
• Going Beyond - Mixing Delphi & Python
• More information, Next steps, Q&A
Slides, links & replay: blogs.embarcadero.com/?p=128183
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
About Jim McKeeth
● Chief Developer Advocate & Engineer for Embarcadero
● Long time software developer
○ Delphi, C/C++, Python, Java, JavaScript, Ruby, etc.
● Invented and patented pattern and swipe to unlock
○ e.g. US Patents # 8352745 & 6766456
● Built thought controlled drone with Google Glass and wireless
EEG headset
● Contributor to Internet of Things and Data Analytics Handbook
● Blogger, podcaster, conference speaker, webinar host, etc.
● Twitter, TikTok, YouTube, etc. @JimMcKeeth
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Target Audience
1. Python devs who want a nice GUI
2. Python devs curious about Delphi
3. Delphi devs who want to use Python
4. Delphi devs curious about what’s new
5. Other devs curious about Delphi & Python
I do my best not to assume too much familiarity with either
Delphi or Python, while still including code and technical details.
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
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.
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
What is Delphi for Python?
● Set of free Python modules bringing Delphi’s GUI libraries to
Python developers
○ Mature, feature rich, native & cross-platform
○ Does not require Delphi to use
● 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
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Introduction to Delphi VCL & FMX
For anyone new to Delphi
with comparisons to Python
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Timeline for Delphi & Python
2008
Python 3.0
A Major revision
with many
improvements.
2011
Delphi XE adds Mac OS
Introducing FireMonkey,
adding Windows 64-bit
and Mac OS as natively
supported platforms.
2018
Guido van Rossum’s
Permanent Vacation
Stepping down as
Python’s benevolent
dictator for life (BDFL).
1995
Delphi Introduced
The successor to Turbo
Pascal, includes the VCL.
Using an evolved version
of Object Pascal.
1991
Python Introduced
Developed by Guido
van Rossum as the
successor to ABC.
2000
Python 2.0
Adding list
comprehensions,
reference counting,
& cycle-detecting
garbage collection
2013
Delphi XE4 & XE5
Compiles to native
ARM supporting,
iPhone, iPad, and
Android.
2017
Delphi 10.2 Tokyo
Support for
natively compiled
x86 64-bit Linux.
Photo of Guido by D. Stroud,et al https://w.wiki/4fSN
Photo for Wirth by Tyomitch https://w.wiki/4fSS
Photo of Hejlsberg by DBegley https://w.wiki/4fST
Today
Delphi for Python
Brings Delphi’s
VCL & FMX
frameworks to
Python
Niklaus Wirth
Guido van Rossum
Anders Hejlsberg
1970
Pascal
Created by
Niklaus Wirth
and Influenced
by ALGOL 68.
1987
ABC Programming Language
An imperative general-
purpose programming
language influenced by
ALGOL 68. Guido van Rossum
worked on ABC system for
several years.
1983
Turbo Pascal
Developed by Anders
Hejlsberg and
promoted by Borland.
The definitive Pascal.
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
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.Rich component ecosystem - There is usually a component for everything
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Zen of Python
19 "guiding principles" that influence the design of the Python programming language
1. Beautiful is better than ugly.
2. Explicit is better than implicit.
3. Simple is better than complex.
4. Complex is better than complicated.
5. Flat is better than nested.
6. Sparse is better than dense.
7. Readability counts.
8. Special cases aren't special enough to break the
rules.
9. Although practicality beats purity.
10. Errors should never pass silently.
11. Unless explicitly silenced.
12. In the face of ambiguity, refuse the temptation to
guess.
13. There should be one – and preferably only one –
obvious way to do it
14. Although that way may not be obvious at first
unless you're Dutch.
15. Now is better than never.
16. Although never is often better than right now.
17. If the implementation is hard to explain, it's a bad
idea.
18. If the implementation is easy to explain, it may
be a good idea.
19. Namespaces are one honking great idea – let's
do more of those!
by Tim Peters, 1999, on the Python mailing list
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Comparison
Introduced in 1995
Original architect is Danish
Commercial license (with free CE)
Statically-typed (Explicit, or inferred)
Manual memory management
with ownership model
Compiled (with interpreted options*)
Popular in line of business applications
↔ Introduced in 1991
↔ Original author is Dutch
↔ Open source
↔ Dynamically-typed
↔ Garbage Collected
(reference counting & cycle-detecting)
↔ Interpreted (optional JIT or compiler)
↔ Popular in research and prototyping
Language encourages best practices & readability
Includes comprehensive reusable libraries
Rich ecosystem of developers and libraries
Supports structured, procedural, functional, and OOP
Fanatical community of developers *Interpreted Delphi options are via 3rd parties
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Components &
Designers
(Very Visual)
Three Levels of Development
Delphi makes it easy to
mix all three!
The productivity of components with
the flexibility & power of Platform APIs.
Common
Libraries
Raw Memory/
Assembly/
Pointers/
Platform
APIs
Productivity
Where you
“Touch the metal”
for max flexibility
L
o
w
C
o
d
e
Universal to all development tools
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
VCL vs FMX
A tale of two GUI frameworks
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
● 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
VCL
Visual Component Library
for Microsoft Windows
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
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:
○ Windows, macOS, iOS, Android, and Linux
○ Uses DirectX on Windows, OpenGL on Linux, OpenGL-ES on Android, and Metal on
iOS and macOS
● Similar to VCL, but not designed to be compatible
○ Designed as cross platform from the ground up
● 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)
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Short Delphi Tour
Delphi IDE, VCL, & FMX
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Short Delphi Tour
● Delphi isn’t required to use the Delphi for Python modules
● The IDE runs on Windows, but targets other platforms
● There are multiple editions and options to get started
● Free options
○ 30-day trial of RAD Studio Enterprise
○ Community Edition (some limitations apply)
● Three paid editions
○ Professional
○ Enterprise
○ Architect
● Note: RAD Studio includes Delphi and C++Builder
Find out mote
embarcadero.com/products/delphi
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Introduction
to Delphi
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Getting Started with
Delphi VCL for Python
Rich GUI Framework for Python
For Windows (32-bit & 64-bit)
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Delphi for Python
● Windows 32-bit and 64-bit only
● Windows 8.1 through Windows 11
○ (Earlier versions may work, but not supported.)
● Based on native Windows components
● Includes Windows Handles, Messages,
Accessibility, etc.
● Styling system
● Uses GPU for custom rendering
● Multi-platform for Windows, Linux, Android,
and Mac OS
● Higher level of abstraction
● Platform services simplifies behaviors
● Styling system
Delphi VCL for Python Delphi FMX for Python
Covering in
webinar
Part 2!
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Delphi VCL for Python Installation
● Supports:
○ Win32 & Win64 x86 architectures
○ Python cp3.6, cp3.7, cp3.8, cp3.9 and cp3.10
● Conda support:
○ Win x86 and x64 from Python cp3.6 to cp3.10
● Install via pip
○ pip install delphivcl
● Details and downloads
○ github.com/Embarcadero/DelphiVCL4Python
○ pypi.org/project/delphivcl/
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Hello Delphi VCL
for Python
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Hello World
from delphivcl import *
class MainForm(Form):
def __init__(self, owner):
self.Caption = "A VCL Form..."
self.SetBounds(10, 10, 500, 400)
self.Position = "poScreenCenter"
self.OnClose = self.__on_form_close
self.lblHello = Label(self)
self.lblHello.SetProps(Parent=self, 
Caption="Hello DelphiVCL for Python")
self.lblHello.SetBounds(10, 10, 300, 24)
def __on_form_close(self, sender, action):
action.Value = caFree
def main():
Application.Initialize()
Application.Title = "Hello Python"
Main = MainForm(Application)
Main.Show()
FreeConsole()
Application.Run()
Main.Destroy()
main()
The simplest example
Configure the form
Create and configure the label
Event handler for the form’s
close event
Initialization the application and
creating the form.
The program loop
Class is a VCL Form
Owner
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Ownership
(Life-cycle)
● Application
○ Form1
■ Panel
■ Label
■ Edit
■ Button
■ Panel
■ Components
○ Form2
■ Components
Parent
(Drawing)
● Form1
○ Panel
■ Button
■ Panel
● Label
● Edit
● Form2
○ Nested Components
■ Nested Components
● Nested Components
A component can not have an owner, but all
visual components (except the Form) have a parent.
Parents hold their children, but don’t necessarily own them.
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Example with Styles
● Activity Indicator sample with option to load and change styles
● github.com/Embarcadero/DelphiVCL4Python/tree/main/samples/ActivityIndicator
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Activity Indicator
with Styles
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Going Further…
Exploring the
Delphi for Python
Bridge
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Design Your UI
in the Delphi IDE
● Take full advantage of the Delphi IDE
designers and property editors
● WYSIWYG preview with styles
● Export the form for use in Python
● Requires no Object Pascal knowledge
● Still write all your code in Python
● Just right-click and export with the DelphiVCL4Python IDE add-in
● github.com/Embarcadero/DelphiVCL4Python/tree/main/experts
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Form Export
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Combine Delphi and Python
● The Python4Delphi library is a bidirectional
bridge
● Develop parts of your solution in Delphi, and
part in Python
○ Play to the strengths of each
● Merge them together into a single cohesive
solution
● Find samples, tutorials, and videos
○ github.com/pyscripter/python4delphi
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
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
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Documentation and
Library References
● Main Delphi documentation
○ Main docwiki.embarcadero.com/RADStudio/en/
○ VCL docwiki.embarcadero.com/RADStudio/en/VCL_Overview
○ FMX docwiki.embarcadero.com/RADStudio/en/FireMonkey
● Library Reference
○ Main docwiki.embarcadero.com/Libraries/en/
○ VCL docwiki.embarcadero.com/Libraries/en/Vcl
○ FMX docwiki.embarcadero.com/Libraries/en/FMX
● Delphi prefixes type names with a “T”
○ TEdit in Delphi is an Edit in Python
○ It is just a naming convention
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
About PyScripter
● Popular free & open-source Python IDE
sponsored by Embarcadero
● All the features expected in a modern Python IDE
while being lightweight and very fast
● Natively compiled for Windows to use minimal
memory with maximum performance
● Full local and remote Python debugging
● Integration with Python tools like PyLint, TabNanny,
Profile, etc.
● Run or debug files from memory.
● embarcadero.com/free-tools/pyscripter/free-download
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
About UltraEdit
● High performance text editor for
programmers.
● Industry's best large file handling: 10+ GB
and beyond.
● Syntax highlighting for nearly any language
or data format.
● Smart templates.
● Hex editing. Column / block mode editing.
● Part of Idera family of developer tools.
● ultraedit.com/products/ultraedit/
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Next Steps
● Install Delphi VCL for Python github.com/Embarcadero/DelphiVCL4Python
○ Star the repository, see the samples, file issues, and make feature requests
● Read the blog post (links, replays) blogs.embarcadero.com/?p=128183
● Join part 2 on FMX & Android https://embt.co/d4p-part2
○ Jan 26th at 9 AM CST (Same registration as Part 1)
● Start a 30-day Delphi trial embarcadero.com/products/delphi/start-for-free
● Subscribe on YouTube youtube.com/c/EmbarcaderoTechnologies
● Follow us on Twitter twitter.com/embarcaderotech
● Like us on Facebook facebook.com/embarcaderotech
● Follow us on LinkedIn linkedin.com/company/embarcadero-technologies
● Read our blog pythongui.org
Delphi for Python
Copyright © 2022 by Embarcadero, an Idera company
Introduction to
Python GUI
Development
with
Delphi for Python
Part 1: Delphi VCL for Python
Jim McKeeth
Chief Developer Advocate
Embarcadero Technologies
jim.mckeeth@embarcadero.com
@JimMcKeeth
Slides, links & replay: blogs.embarcadero.com/?p=128183
Q&A

More Related Content

PDF
Embedded Systems: Lecture 14: Introduction to GNU Toolchain (Binary Utilities)
DOCX
Glossário de Termos Técnicos em Redes de Computadores
PDF
Introduction to python
PPTX
introduction to Python (for beginners)
PDF
Data analysis from scratch with python beginner guide
ODP
Introduction to Python - Training for Kids
PPTX
Introduction to Python Programming
ODP
Python slide.1
Embedded Systems: Lecture 14: Introduction to GNU Toolchain (Binary Utilities)
Glossário de Termos Técnicos em Redes de Computadores
Introduction to python
introduction to Python (for beginners)
Data analysis from scratch with python beginner guide
Introduction to Python - Training for Kids
Introduction to Python Programming
Python slide.1

What's hot (20)

PPT
Intro to Python
PDF
Understanding greenlet
PPTX
Estrutura de Dados - Conceitos fundamentais
PPTX
Programming
PDF
Introduction to python
PPTX
Prgramming paradigms
PPT
python-ppt.ppt
PPTX
Introduction to Python Programming Basics
PPTX
Java: Manipulação de Arquivos
PPTX
Python ppt
PDF
Multi threading
PDF
Introduction to Data Visualization,Matplotlib.pdf
PDF
NLP Project Full Cycle
PPTX
Phython Programming Language
PDF
Aula de Introdução - JAVA
PPTX
Python for Beginners(v1)
PPTX
Github
PPTX
oop.pptx
PDF
Python programming : Abstract classes interfaces
PPTX
Introduction python
Intro to Python
Understanding greenlet
Estrutura de Dados - Conceitos fundamentais
Programming
Introduction to python
Prgramming paradigms
python-ppt.ppt
Introduction to Python Programming Basics
Java: Manipulação de Arquivos
Python ppt
Multi threading
Introduction to Data Visualization,Matplotlib.pdf
NLP Project Full Cycle
Phython Programming Language
Aula de Introdução - JAVA
Python for Beginners(v1)
Github
oop.pptx
Python programming : Abstract classes interfaces
Introduction python
Ad

Similar to Introduction to Python GUI development with Delphi for Python - Part 1: Delphi VCL for Python (20)

PDF
PyTorch for Delphi - Python Data Sciences Libraries.pdf
PDF
Python on Android with Delphi FMX - The Cross Platform GUI Framework
PDF
The Best Python IDEs and Code Editors.pdf
PDF
Best things to know about .net framework
PDF
Docker based-Pipelines with Codefresh
PDF
Docker based-pipelines
PPTX
OneAPI_Tool.pptx
PPTX
20 best ide's for python programming in 2018
PPTX
2018 20 best id es for python programming
PDF
Using Delphi as a no code development environment
PPTX
oneAPI: Industry Initiative & Intel Product
PDF
Redfish and python-redfish for Software Defined Infrastructure
PDF
Language Matters: JavaScript 
from IoT Product Concept 
to Production
ODP
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
PPTX
Flutter talkshow
PDF
OpenNTF Webinar 05/07/13: OpenNTF - The IBM Collaboration Solutions App Dev C...
PPTX
Intel Developer Program
PDF
nativeappdevelopmentwithpython1658264723355.pdf
PDF
DEEP: a user success story
PDF
React native vs. flutter a detailed analysis
PyTorch for Delphi - Python Data Sciences Libraries.pdf
Python on Android with Delphi FMX - The Cross Platform GUI Framework
The Best Python IDEs and Code Editors.pdf
Best things to know about .net framework
Docker based-Pipelines with Codefresh
Docker based-pipelines
OneAPI_Tool.pptx
20 best ide's for python programming in 2018
2018 20 best id es for python programming
Using Delphi as a no code development environment
oneAPI: Industry Initiative & Intel Product
Redfish and python-redfish for Software Defined Infrastructure
Language Matters: JavaScript 
from IoT Product Concept 
to Production
JDD2015: Towards the Fastest (J)VM on the Planet! - Jaroslav Tulach
Flutter talkshow
OpenNTF Webinar 05/07/13: OpenNTF - The IBM Collaboration Solutions App Dev C...
Intel Developer Program
nativeappdevelopmentwithpython1658264723355.pdf
DEEP: a user success story
React native vs. flutter a detailed analysis
Ad

More from Embarcadero Technologies (20)

PDF
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
PDF
Linux GUI Applications on Windows Subsystem for Linux
PDF
FMXLinux Introduction - Delphi's FireMonkey for Linux
PDF
Python for Delphi Developers - Part 2
PPTX
Python for Delphi Developers - Part 1 Introduction
PDF
RAD Industrial Automation, Labs, and Instrumentation
PDF
Embeddable Databases for Mobile Apps: Stress-Free Solutions with InterBase
PDF
Rad Server Industry Template - Connected Nurses Station - Setup Document
PPTX
TMS Google Mapping Components
PDF
Move Desktop Apps to the Cloud - RollApp & Embarcadero webinar
PPTX
Useful C++ Features You Should be Using
PPTX
Getting Started Building Mobile Applications for iOS and Android
PPTX
Embarcadero RAD server Launch Webinar
PPTX
ER/Studio 2016: Build a Business-Driven Data Architecture
PPTX
The Secrets of SQL Server: Database Worst Practices
PDF
Driving Business Value Through Agile Data Assets
PDF
Troubleshooting Plan Changes with Query Store in SQL Server 2016
PDF
Great Scott! Dealing with New Datatypes
PDF
Agile, Automated, Aware: How to Model for Success
PDF
What's New in DBArtisan and Rapid SQL 2016
Android on Windows 11 - A Developer's Perspective (Windows Subsystem For Andr...
Linux GUI Applications on Windows Subsystem for Linux
FMXLinux Introduction - Delphi's FireMonkey for Linux
Python for Delphi Developers - Part 2
Python for Delphi Developers - Part 1 Introduction
RAD Industrial Automation, Labs, and Instrumentation
Embeddable Databases for Mobile Apps: Stress-Free Solutions with InterBase
Rad Server Industry Template - Connected Nurses Station - Setup Document
TMS Google Mapping Components
Move Desktop Apps to the Cloud - RollApp & Embarcadero webinar
Useful C++ Features You Should be Using
Getting Started Building Mobile Applications for iOS and Android
Embarcadero RAD server Launch Webinar
ER/Studio 2016: Build a Business-Driven Data Architecture
The Secrets of SQL Server: Database Worst Practices
Driving Business Value Through Agile Data Assets
Troubleshooting Plan Changes with Query Store in SQL Server 2016
Great Scott! Dealing with New Datatypes
Agile, Automated, Aware: How to Model for Success
What's New in DBArtisan and Rapid SQL 2016

Recently uploaded (20)

PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Designing Intelligence for the Shop Floor.pdf
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
System and Network Administraation Chapter 3
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
assetexplorer- product-overview - presentation
PPTX
Transform Your Business with a Software ERP System
PPTX
Introduction to Artificial Intelligence
PPTX
Computer Software and OS of computer science of grade 11.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Why Generative AI is the Future of Content, Code & Creativity?
Design an Analysis of Algorithms I-SECS-1021-03
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Which alternative to Crystal Reports is best for small or large businesses.pdf
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Navsoft: AI-Powered Business Solutions & Custom Software Development
Designing Intelligence for the Shop Floor.pdf
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
System and Network Administraation Chapter 3
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
How to Choose the Right IT Partner for Your Business in Malaysia
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Softaken Excel to vCard Converter Software.pdf
Digital Systems & Binary Numbers (comprehensive )
assetexplorer- product-overview - presentation
Transform Your Business with a Software ERP System
Introduction to Artificial Intelligence
Computer Software and OS of computer science of grade 11.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Why Generative AI is the Future of Content, Code & Creativity?

Introduction to Python GUI development with Delphi for Python - Part 1: Delphi VCL for Python

  • 1. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Jim McKeeth Chief Developer Advocate Embarcadero Technologies [email protected] @JimMcKeeth Slides, links & replay: blogs.embarcadero.com/?p=128183 Introduction to Python GUI Development with Delphi for Python Part 1: Delphi VCL for Python
  • 2. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Agenda • Introduction to Delphi VCL & FMX • Architecture and platforms • Installing and using Delphi VCL for Python • Demonstrations & Code • Going Beyond - Mixing Delphi & Python • More information, Next steps, Q&A Slides, links & replay: blogs.embarcadero.com/?p=128183
  • 3. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company About Jim McKeeth ● Chief Developer Advocate & Engineer for Embarcadero ● Long time software developer ○ Delphi, C/C++, Python, Java, JavaScript, Ruby, etc. ● Invented and patented pattern and swipe to unlock ○ e.g. US Patents # 8352745 & 6766456 ● Built thought controlled drone with Google Glass and wireless EEG headset ● Contributor to Internet of Things and Data Analytics Handbook ● Blogger, podcaster, conference speaker, webinar host, etc. ● Twitter, TikTok, YouTube, etc. @JimMcKeeth
  • 4. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Target Audience 1. Python devs who want a nice GUI 2. Python devs curious about Delphi 3. Delphi devs who want to use Python 4. Delphi devs curious about what’s new 5. Other devs curious about Delphi & Python I do my best not to assume too much familiarity with either Delphi or Python, while still including code and technical details.
  • 5. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company 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.
  • 6. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company What is Delphi for Python? ● Set of free Python modules bringing Delphi’s GUI libraries to Python developers ○ Mature, feature rich, native & cross-platform ○ Does not require Delphi to use ● 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
  • 7. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Introduction to Delphi VCL & FMX For anyone new to Delphi with comparisons to Python
  • 8. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Timeline for Delphi & Python 2008 Python 3.0 A Major revision with many improvements. 2011 Delphi XE adds Mac OS Introducing FireMonkey, adding Windows 64-bit and Mac OS as natively supported platforms. 2018 Guido van Rossum’s Permanent Vacation Stepping down as Python’s benevolent dictator for life (BDFL). 1995 Delphi Introduced The successor to Turbo Pascal, includes the VCL. Using an evolved version of Object Pascal. 1991 Python Introduced Developed by Guido van Rossum as the successor to ABC. 2000 Python 2.0 Adding list comprehensions, reference counting, & cycle-detecting garbage collection 2013 Delphi XE4 & XE5 Compiles to native ARM supporting, iPhone, iPad, and Android. 2017 Delphi 10.2 Tokyo Support for natively compiled x86 64-bit Linux. Photo of Guido by D. Stroud,et al https://w.wiki/4fSN Photo for Wirth by Tyomitch https://w.wiki/4fSS Photo of Hejlsberg by DBegley https://w.wiki/4fST Today Delphi for Python Brings Delphi’s VCL & FMX frameworks to Python Niklaus Wirth Guido van Rossum Anders Hejlsberg 1970 Pascal Created by Niklaus Wirth and Influenced by ALGOL 68. 1987 ABC Programming Language An imperative general- purpose programming language influenced by ALGOL 68. Guido van Rossum worked on ABC system for several years. 1983 Turbo Pascal Developed by Anders Hejlsberg and promoted by Borland. The definitive Pascal.
  • 9. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company 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.Rich component ecosystem - There is usually a component for everything
  • 10. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Zen of Python 19 "guiding principles" that influence the design of the Python programming language 1. Beautiful is better than ugly. 2. Explicit is better than implicit. 3. Simple is better than complex. 4. Complex is better than complicated. 5. Flat is better than nested. 6. Sparse is better than dense. 7. Readability counts. 8. Special cases aren't special enough to break the rules. 9. Although practicality beats purity. 10. Errors should never pass silently. 11. Unless explicitly silenced. 12. In the face of ambiguity, refuse the temptation to guess. 13. There should be one – and preferably only one – obvious way to do it 14. Although that way may not be obvious at first unless you're Dutch. 15. Now is better than never. 16. Although never is often better than right now. 17. If the implementation is hard to explain, it's a bad idea. 18. If the implementation is easy to explain, it may be a good idea. 19. Namespaces are one honking great idea – let's do more of those! by Tim Peters, 1999, on the Python mailing list
  • 11. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Comparison Introduced in 1995 Original architect is Danish Commercial license (with free CE) Statically-typed (Explicit, or inferred) Manual memory management with ownership model Compiled (with interpreted options*) Popular in line of business applications ↔ Introduced in 1991 ↔ Original author is Dutch ↔ Open source ↔ Dynamically-typed ↔ Garbage Collected (reference counting & cycle-detecting) ↔ Interpreted (optional JIT or compiler) ↔ Popular in research and prototyping Language encourages best practices & readability Includes comprehensive reusable libraries Rich ecosystem of developers and libraries Supports structured, procedural, functional, and OOP Fanatical community of developers *Interpreted Delphi options are via 3rd parties
  • 12. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Components & Designers (Very Visual) Three Levels of Development Delphi makes it easy to mix all three! The productivity of components with the flexibility & power of Platform APIs. Common Libraries Raw Memory/ Assembly/ Pointers/ Platform APIs Productivity Where you “Touch the metal” for max flexibility L o w C o d e Universal to all development tools
  • 13. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company VCL vs FMX A tale of two GUI frameworks
  • 14. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company ● 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 VCL Visual Component Library for Microsoft Windows
  • 15. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company 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: ○ Windows, macOS, iOS, Android, and Linux ○ Uses DirectX on Windows, OpenGL on Linux, OpenGL-ES on Android, and Metal on iOS and macOS ● Similar to VCL, but not designed to be compatible ○ Designed as cross platform from the ground up ● 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)
  • 16. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Short Delphi Tour Delphi IDE, VCL, & FMX
  • 17. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Short Delphi Tour ● Delphi isn’t required to use the Delphi for Python modules ● The IDE runs on Windows, but targets other platforms ● There are multiple editions and options to get started ● Free options ○ 30-day trial of RAD Studio Enterprise ○ Community Edition (some limitations apply) ● Three paid editions ○ Professional ○ Enterprise ○ Architect ● Note: RAD Studio includes Delphi and C++Builder Find out mote embarcadero.com/products/delphi
  • 18. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Introduction to Delphi
  • 19. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Getting Started with Delphi VCL for Python Rich GUI Framework for Python For Windows (32-bit & 64-bit)
  • 20. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Delphi for Python ● Windows 32-bit and 64-bit only ● Windows 8.1 through Windows 11 ○ (Earlier versions may work, but not supported.) ● Based on native Windows components ● Includes Windows Handles, Messages, Accessibility, etc. ● Styling system ● Uses GPU for custom rendering ● Multi-platform for Windows, Linux, Android, and Mac OS ● Higher level of abstraction ● Platform services simplifies behaviors ● Styling system Delphi VCL for Python Delphi FMX for Python Covering in webinar Part 2!
  • 21. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Delphi VCL for Python Installation ● Supports: ○ Win32 & Win64 x86 architectures ○ Python cp3.6, cp3.7, cp3.8, cp3.9 and cp3.10 ● Conda support: ○ Win x86 and x64 from Python cp3.6 to cp3.10 ● Install via pip ○ pip install delphivcl ● Details and downloads ○ github.com/Embarcadero/DelphiVCL4Python ○ pypi.org/project/delphivcl/
  • 22. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Hello Delphi VCL for Python
  • 23. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Hello World from delphivcl import * class MainForm(Form): def __init__(self, owner): self.Caption = "A VCL Form..." self.SetBounds(10, 10, 500, 400) self.Position = "poScreenCenter" self.OnClose = self.__on_form_close self.lblHello = Label(self) self.lblHello.SetProps(Parent=self, Caption="Hello DelphiVCL for Python") self.lblHello.SetBounds(10, 10, 300, 24) def __on_form_close(self, sender, action): action.Value = caFree def main(): Application.Initialize() Application.Title = "Hello Python" Main = MainForm(Application) Main.Show() FreeConsole() Application.Run() Main.Destroy() main() The simplest example Configure the form Create and configure the label Event handler for the form’s close event Initialization the application and creating the form. The program loop Class is a VCL Form Owner
  • 24. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Ownership (Life-cycle) ● Application ○ Form1 ■ Panel ■ Label ■ Edit ■ Button ■ Panel ■ Components ○ Form2 ■ Components Parent (Drawing) ● Form1 ○ Panel ■ Button ■ Panel ● Label ● Edit ● Form2 ○ Nested Components ■ Nested Components ● Nested Components A component can not have an owner, but all visual components (except the Form) have a parent. Parents hold their children, but don’t necessarily own them.
  • 25. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Example with Styles ● Activity Indicator sample with option to load and change styles ● github.com/Embarcadero/DelphiVCL4Python/tree/main/samples/ActivityIndicator
  • 26. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Activity Indicator with Styles
  • 27. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Going Further… Exploring the Delphi for Python Bridge
  • 28. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Design Your UI in the Delphi IDE ● Take full advantage of the Delphi IDE designers and property editors ● WYSIWYG preview with styles ● Export the form for use in Python ● Requires no Object Pascal knowledge ● Still write all your code in Python ● Just right-click and export with the DelphiVCL4Python IDE add-in ● github.com/Embarcadero/DelphiVCL4Python/tree/main/experts
  • 29. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Form Export
  • 30. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Combine Delphi and Python ● The Python4Delphi library is a bidirectional bridge ● Develop parts of your solution in Delphi, and part in Python ○ Play to the strengths of each ● Merge them together into a single cohesive solution ● Find samples, tutorials, and videos ○ github.com/pyscripter/python4delphi
  • 31. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company 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
  • 32. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Documentation and Library References ● Main Delphi documentation ○ Main docwiki.embarcadero.com/RADStudio/en/ ○ VCL docwiki.embarcadero.com/RADStudio/en/VCL_Overview ○ FMX docwiki.embarcadero.com/RADStudio/en/FireMonkey ● Library Reference ○ Main docwiki.embarcadero.com/Libraries/en/ ○ VCL docwiki.embarcadero.com/Libraries/en/Vcl ○ FMX docwiki.embarcadero.com/Libraries/en/FMX ● Delphi prefixes type names with a “T” ○ TEdit in Delphi is an Edit in Python ○ It is just a naming convention
  • 33. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company About PyScripter ● Popular free & open-source Python IDE sponsored by Embarcadero ● All the features expected in a modern Python IDE while being lightweight and very fast ● Natively compiled for Windows to use minimal memory with maximum performance ● Full local and remote Python debugging ● Integration with Python tools like PyLint, TabNanny, Profile, etc. ● Run or debug files from memory. ● embarcadero.com/free-tools/pyscripter/free-download
  • 34. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company About UltraEdit ● High performance text editor for programmers. ● Industry's best large file handling: 10+ GB and beyond. ● Syntax highlighting for nearly any language or data format. ● Smart templates. ● Hex editing. Column / block mode editing. ● Part of Idera family of developer tools. ● ultraedit.com/products/ultraedit/
  • 35. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Next Steps ● Install Delphi VCL for Python github.com/Embarcadero/DelphiVCL4Python ○ Star the repository, see the samples, file issues, and make feature requests ● Read the blog post (links, replays) blogs.embarcadero.com/?p=128183 ● Join part 2 on FMX & Android https://embt.co/d4p-part2 ○ Jan 26th at 9 AM CST (Same registration as Part 1) ● Start a 30-day Delphi trial embarcadero.com/products/delphi/start-for-free ● Subscribe on YouTube youtube.com/c/EmbarcaderoTechnologies ● Follow us on Twitter twitter.com/embarcaderotech ● Like us on Facebook facebook.com/embarcaderotech ● Follow us on LinkedIn linkedin.com/company/embarcadero-technologies ● Read our blog pythongui.org
  • 36. Delphi for Python Copyright © 2022 by Embarcadero, an Idera company Introduction to Python GUI Development with Delphi for Python Part 1: Delphi VCL for Python Jim McKeeth Chief Developer Advocate Embarcadero Technologies [email protected] @JimMcKeeth Slides, links & replay: blogs.embarcadero.com/?p=128183 Q&A