I want to compile c code using GCC via Python subprocess. I have installed MinGW gcc for this. When I run the command on the command line, the executable is made, but when I try to do the same via Python subprocess, I get 1 exit code, and hence no executable is made. The command in question :
C:/MinGW/bin/gcc E:/some/folders/main.c
What I'm trying to do
import subprocess
print(subprocess.run('C:/MinGW/bin/gcc E:/some/folders/main.c', shell=True))
Is there something fundamentally wrong here with how I am approaching this ? Thanks