import subprocess subprocess.call(["gcc", "your c file"]) subprocess.call("./a.out")
#compile c code first import os os.system("command to execute code here")