I have the following C Program
#include <stdio.h>
int main()
{
char a[200];
a[199] = 0;
printf("Enter some input ->\n");
scanf("%s" ,a);
printf ("\nInput was %s\n", a);
return 0;
}
and I'm trying to write some input into it the following way:
from subprocess import *
a = Popen(["my_prog.elf", stdin=PIPE)
a.stdin.write("MyInput")
yet this doesn't appear to work.... any ideas how to fix this?
** edit **
does anyone have any clue why a.stdin.flush() wont work?