I have the following code in python, which I use to read all the files in the specified path, and process them all by the C++ source code.
import os
import os.path
import subprocess
path = '/Users/'
dirs = os.listdir(path)
for path in dirs:
if 'whatever' in path and not os.path.splitext(path)[1]:
proc = subprocess.Popen(["./cppSourceCode", path])
It works fine if the files (which are the input to my C++ code) are all in the same folder with C++ source code, and the output would be also in the same folder.
However, what I want to do is to put the data files in a folder (e.g. Data Folder), the output should go to a different folder (e.g. The output) while my C++ and Python codes are in their folder (e.g. Codes folder)
How this could be done? How to make this doable using 3 different folders?