Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I now have a Python project that is in charge of generating the simulation data

ID: 654984 • Letter: I

Question

I now have a Python project that is in charge of generating the simulation data and visualizing the simulation and processed data. A C++ console application is already available in my Visual Studio.

The processing sequence is as follows:

Python project generates the raw data into data.txt.
Visual Studio C++ console application takes in data.txt and processes the data, and finally outputs results.txt.
Python project takes in results.txt and visualizes it with matplotlib.
I am now doing it manually, and it works perfectly ok for one run. However, it becomes extremely troublesome when I want to have multiple runs.

Questions:

How may I integrate them together? Integrate Python project into Visual Studio or integrate C++ console application into Spyder (my Python IDE)?
Currently, I manually enter the debugging parameters in the C++ console application debugging property. How may I make it automatic? i.e. After Python project generates data.txt, the data.txt gets automatically taken in as parameters by the C++ console application?
c++ python

Explanation / Answer

IDE stands for Indegrated Development Environment. It is not concerned with running your application except for debugging. There is no point integrating the IDEs, the user won't have them installed.

What you should do is make of of the applications run the other, directly, not involving either IDE.

You can execute external process from Python using the subprocess module (python3 doc).

You can execute external process from C++ using the system function (windows doc) (platform independent, not very powerful, but should be enough for your purpose) or using the windows-specific CreateProcess interface (on POSIX, you use the exec interface), but I don't think you need this direction just now.