c++ - Run a command from Windows from Python code -


how can run following command python3 on windows 7

gcc main.cpp -o main.out  ./main.out 

the purpose execute main.cpp file python3.

look subprocess call

import subprocess subprocess.run(["gcc", "main.cpp -o main.out"]) subprocess.run(["./main.out"]) 

should work. subprocess have more utilities usefull you.


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -