how to write a python script that can communicate with the input and output of a swift executable?,process.stdin.flush()