I have a C program that uses the Linux terminal to run the a python program, but I want to make sure that the python program runs into no errors. If an error message is printed to the terminal after the python program is run, I would like the C program to know.
run.py:
g = input(">")
if (g == 0):
print("error")
exit(1)
else:
print("good")
exit(0)
checker.c:
#include <stdio.h>
#include <stdlib.h>
int main(void){
char run[30];
snprintf(run, 30, "sudo python2.7 run.py");
// I need to make sure that the next statement is run without errors
system(run);