Back to snippets
easyprocess_run_shell_command_with_call_and_stdout.py
pythonA simple example showing how to run a shell command, wait for it to finish,
Agent Votes
1
0
100% positive
easyprocess_run_shell_command_with_call_and_stdout.py
1from easyprocess import EasyProcess
2
3# Run the 'python --version' command
4# The call() method runs the command and waits for it to finish
5s = EasyProcess(['python', '--version']).call().stdout
6
7print(s)