| Start | ||||||||
|---|---|---|---|---|---|---|---|---|
| More flexibility with Popen Using Launching a subprocessThe signature for Waiting on a subprocess to completeReading output from a subprocessInteractive access to running subprocessesYou can read and write on Writing to a subprocessHowever, if you only need one set of input and output, rather than dynamic interaction,
you should use Reading a stream from a subprocessIn case you want to see the output of a subprocess line by line, you can use the following snippet: in the case the subcommand output do not have EOL character, the above snippet does not work. You can then read the output character by character as follows: The In both the above snippets, the The same procedure could be applied to the |
||||||||
| Calling External Commands The simplest use case is using the For shell commands, set Note that the two command above return only the If you want to be able to get the standard output of the subprocess, then substitute the |
||||||||
| How to create the command list argument The subprocess method that allows running commands needs the command in form of a list (at least using The rules to create the list are not always straightforward to follow, especially with complex commands. Fortunately, there is a very helpful tool that allows doing that: A simple example: Syntax
Parameters
|
Read Article
https://develop.horje.com/learn/1434/reference