David I. has a fantastic blog post on using Python4Delphi with C++Builder.
https://davidiontools.com/2020/10/13/using-python4delphi-with-cbuilder-vcl-applications/
This was inspired by our previous webinars on the topic. and is the result of his collaboration with Kiriakos (AKA PyScripter), the maintainer of Python4Delphi, who also made some changes in the library to work better with C++Builder.
By popular request, David and Kiriakos have also agreed to run a Python for C++ developers webinar where you can learn to leverage Python from your favorite C++ developer tools.
https://blogs.embarcadero.com/using-python4delphi-with-cbuilder-vcl-applications/
https://youtu.be/TpmT-CeMfVM
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Python for C++ Fevelopers with David I. & Kiriakos Vlahos - Webinar Slides
1. 1
Using Python4Delphi with C++Builder
●
David I (Embarcadero MVP)
●
Kiriakos Vlahos (aka PyScripter)
●
Jim McKeeth (Embarcadero)
●
David Millington (Embarcadero)
2. 2
Agenda
●
Using C++Builder with Python
●
Delphi4Python Overview
●
Delphi4Python components
●
Preparing C++Builder and Python4Delphi
●
C++ Demos
●
Summary
●
Additional Resources
●
Q&A
3. 3
Using C++Builder with Python
●
Natural to use C/C++ and Python
●
Lots of Python re-usable packages
●
C++ component architecture, GUI, language
●
Both are among the top used languages
●
Ways to use C++Builder and Python
– Use the Delphi4Python components
– Create Python C/C++ modules
– Boost Library for Python
4. 4
Delphi4Python Overview
●
Access to the Python APIs
●
Bi-directional interaction with both languages
●
Access to Python objects
●
Wrap C++ objects for use from Python
●
Create Python extension modules
5. 5
Delphi4Python components
●
PythonEngine: Load and Connect. Low-level API access.
●
PythonModule: Create C++ module to be used by Python
●
PythonType: Python class to be used by C++Builder
●
PythonInputOutput: send/receive to/from Python script
●
PythonGUIInputOutput: connect Python output to a TMemo
●
PyDelphiWrapper: classes/objects accessible from Python
●
unit VarPython: provides hi-level access to Python Objects
6. 6
Preparing C++Builder and Python4Delphi
●
Install Python distro - python.org - Win32 and Win64
●
PIP install Python modules required by C++ projects
●
Clone/Download Delphi4Python GitHub repository
●
Set IDE Library and browse paths for Win32 and Win64
●
Build and Install the components for 10.4+ or 10.3-
– Set the Project | Options | Building | Delphi Compiler | Output - C++ |
C/C++ Output file Generation: Generate all C++Builder files (including
package libs)
– Use command line Delphi compilers or RAD Studio IDE to generate files
that C++Builder needs
7. 7
C++ Demos
●
Demo01 (from the Delphi4Python distro)
– Execute Python scripts
– Display the results
●
Demo19 (from the Delphi4Python distro)
– Define a new Module
– Call C++ method from Python
8. 8
Summary
●
C++Builder has multiple ways to
integrate with Python
●
Delphi4Python is the fastest/easiest
way to connect C++Builder with Python
●
Enjoy the benefits of leveraging the
active Python open-source community
9. 9
Additional Resources
●
Delphi and Python webinar 1 & 2 replays
– https://blogs.embarcadero.com/webinar-replay-python-for-delphi-developers-part-1-introduction/
– https://blogs.embarcadero.com/combining-the-strengths-of-delphi-and-python/
●
Using Python4Delphi with C++Builder VCL applications
– https://davidiontools.com/2020/10/13/using-python4delphi-with-cbuilder-vcl-applications/
●
Delphi4Python GitHub
– https://github.com/pyscripter/python4delphi
●
Getting Started with Python4Delphi
– https://blogs.embarcadero.com/getting-started-wit-python4delphi/
●
Support on DelphiPraxis
– https://en.delphipraxis.net/forum/39-python4delphi/
●
Introductory tutorial by Dr K. R. Bond
– https://github.com/pyscripter/python4delphi/wiki/Files/Chapter80Tutorial.pdf
– https://github.com/pyscripter/python4delphi/wiki/Files/Chapter80Sample.pdf
●
Webinar Tutorials
– https://github.com/pyscripter/python4delphi/tree/master/Tutorials/Webinar%20I
– https://github.com/pyscripter/python4delphi/tree/master/Tutorials/Webinar%20II