I have the next program written in c:
#include <stdio.h>
int main()
{
while(1)
{
printf("hey\n");
}
return 0;
}
and this program in python
from subprocess import Popen, PIPE
def main():
proc = Popen("procname.o", stdin=PIPE, stdout=PIPE, shell=True)
while True:
print proc.stdout.read()
if __name__ == '__main__':
main()
yet this line blocks:
proc.stdout.read()
any ideas why? have anyone encountered this before?