in a standalone C++ program (for windows only) I want to call python scripts in a separate process.
I have the following requirements:
- The user should not have to install python to run the C++ main-program.
- all python dependencies are provided with the installation of the main program
- Based on user input, the C++ program would call different scripts for different tasks.
- Scripts are standalone and communicate over ZeroMQ with the main process (therefore, I would like to pass an address and a port to the python script, in the moment of calling it)
- The python scripts are currently organized as PDM Packages. This is great for development, I would love to keep that
- Since I would like to keep some parts of my python script closed source, a big benefit would be to deliver my scripts in a closed format.
How would I achieve this in an elegant and secure way?
I would like to avoid shell-based approaches like exec()
, system()
or popen()
because of security reasons, or is it ok to use these?
New contributor
LorenzNew is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5