How can I run the following command from Python3 on Windows 7
gcc main.cpp -o main.out
./main.out
The purpose is to execute the main.cpp file from Python3.
How can I run the following command from Python3 on Windows 7
gcc main.cpp -o main.out
./main.out
The purpose is to execute the main.cpp file from Python3.
look subprocess call
import subprocess
subprocess.run(["gcc", "main.cpp -o main.out"])
subprocess.run(["./main.out"])
should work. But subprocess have more utilities that will be usefull for you.