1. Download or directly clone the python4delphi component resources to the specified directory. I downloaded it to the Components folder and renamed the downloaded folder to (P4D). Renaming is not necessary.
Download address: https://github.com/pyscripter/python4delphi
2.Installation
2.1 Go to the Install folder in the downloaded directory and double-click MultiInstaller.exe to install, as shown in the figure below
2.1 Select the package that needs to be installed to install it, click next to continue, see the picture below
2.2 Select the Components folder in step 1 and check it. Click next to start the installation, see the picture below
2.3 The result after the installation is completed, see the picture below, click finish to complete the installation.
3. Run the test to see if the installation is successful.
3.1 Open delphi11, select Components\P4D\Demos\Demo01\Demo01.dproj to open
3.1 Select the PythonEngine control and modify the properties as follows:
Uncheck UseLastKnownVersion
Add DllPath path
Modify DllName name
3.2 The modified result is as shown below:
Note here that it must be a 32-bit pythondll
3.2 Add OnBeforeLoad event to PythonEngine control:
Add the following content: PythonEngine1.SetPythonHome(PythonEngine1.DllPath);