I have a C++ program which prints some data, but I call the program from my python script (I have performed boost python integration). But now I want to read the data which I have generated, from the same python script, but I just don't know how (new to Python).
I tried some recommendation from stack overflow such as
import subprocess
command = ['ls', '-l']
p = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.IGNORE)
text = p.stdout.read()
retcode = p.wait()
but the compiler throws an error module 'subprocess' has not attribute 'IGNORE'
Maybe I have compatibility issues with my current version of Python. I use Python 3.6.7 environment installed with Microsoft Visual Studio 2019. Can it be one of the reasons?
The data I need to read looks like this on the command prompt:
sol1=3.14789865446, .............................. (6 float values)
sol2=4.68909927756, .............................. (6 float values)
.
.
.
.
sol7=0.64527278288, .............................. (6 float values)