input, output = process.stdin, process.stdout
input.write('hello world !')
print(output.read().decode('latin1'))
input.close()
output.close()
status = process.wait()
How to write python code to access input and output from a program written in C?