Communicating with a running process
问题 We have: A Python based server (A) A running command-line application (on the same Linux machine) which is able to read stdin , computes something and provides the output into stdout (B) What is the best (most elegant) way how to send an input from (A) to stdin of (B), and wait for an answer from (B), i.e read its stdout ? 回答1: As @Deestan pointed subprocess,module, is an elegant and proven one. We use subprocess a lot when we have to run commands from python. Ours mostly involves running a