Python Module subprocess: Difference between revisions
Jump to navigation
Jump to search
Line 17: | Line 17: | ||
print(stderr) | print(stderr) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<font color=darkkhaki>Need standard failure handling patter.</font> | |||
<font color=darkkhaki>TO PROCESS: https://janakiev.com/blog/python-shell-commands/</font> | <font color=darkkhaki>TO PROCESS: https://janakiev.com/blog/python-shell-commands/</font> |
Revision as of 00:00, 12 March 2022
External
Internal
Overview
Execute an O/S Command
import subprocess
helm = subprocess.Popen(['helm', 'package', './my-chart'],
cwd = str(Path(project_dir, 'build/helm')),
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True)
stdout, stderr = helm.communicate()
print(stdout)
print(stderr)
Need standard failure handling patter.
TO PROCESS: https://janakiev.com/blog/python-shell-commands/