title: Keep process running while program continues C++
body: <p>I want to be able to call a function in a python script through C++. The function will print some text to stdout.</p>
  
  <p>However, the python script takes about 1 minute to load the global variables to memory, so I want to keep the process alive in interactive mode, where I would be able to simply call the function again without loading all the variables again.</p>
  
  <p>I know that I can run system commands using <a href="http://www.cplusplus.com/reference/cstdlib/system/" rel="nofollow noreferrer">system</a>, but the command must terminate before I can use the output. I am also aware that I can use CPython and call <code>PyRun_SimpleFileEx</code> on the file, but this will have to reload all the variables again</p>
  
  <p>I don't have any code to show since I don't know how to do this. Is there any way I can do this without rewriting the whole python script in C++?</p>