doc:appunti:prog:python_program_execution
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
doc:appunti:prog:python_program_execution [2017/07/16 06:44] – [Run two commands in a pipe] niccolo | doc:appunti:prog:python_program_execution [2022/07/01 10:56] (current) – [Get the output of a program] niccolo | ||
---|---|---|---|
Line 28: | Line 28: | ||
<code python> | <code python> | ||
- | output = subprocess.Popen([" | + | output = subprocess.Popen([" |
</ | </ | ||
Line 37: | Line 37: | ||
output, stderr = subproc.communicate() | output, stderr = subproc.communicate() | ||
retcode = subproc.returncode | retcode = subproc.returncode | ||
- | for line in output.splitlines(): | + | for line in output.decode(' |
- | print line | + | print(line) |
</ | </ | ||
doc/appunti/prog/python_program_execution.1500180248.txt.gz · Last modified: 2017/07/16 06:44 by niccolo