You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above program, when run with `echo "Hello, World!" | gzip | python myscript.py` will show the uncompressed string `Hello, World!`
219
+
220
+
You can use whatever file descriptor you want, basic ones being sys.stdin for text input and sys.stdin.buffer for binary input.
221
+
222
+
#### stdout / stderr stream redirection
204
223
205
224
command_runner can redirect stdout and/or stderr streams to different outputs:
206
225
- subprocess pipes
@@ -426,6 +445,7 @@ It also uses the following standard arguments:
426
445
- timeout (int): seconds before a process tree is killed forcefully, defaults to 3600
427
446
- shell (bool): Shall we use the cmd.exe or /usr/bin/env shell for command execution, defaults to False
428
447
- encoding (str/bool): Which text encoding the command produces, defaults to cp437 under Windows and utf-8 under Linux
448
+
- stdin (sys.stdin/int): Optional stdin file descriptor, sent to the process command_runner spawns
429
449
- stdout (str/queue.Queue/function/False/None): Optional path to filename where to dump stdout, or queue where to write stdout, or callback function which is called when stdout has output
430
450
- stderr (str/queue.Queue/function/False/None): Optional path to filename where to dump stderr, or queue where to write stderr, or callback function which is called when stderr has output
431
451
- no_close_queues (bool): Normally, command_runner sends None to stdout / stderr queues when process is finished. This behavior can be disabled allowing to reuse those queues for other functions wrapping command_runner
0 commit comments