Search notes:

Python standard library: subprocess

The standard library module subprocess can be used to start new process.
This module also allows to read/write into/from stdin, stdout and stderr.
subprocess intends to replace

Popen

from subprocess import Popen

proc = Popen(['gvim', __file__])
print('pid = {}'.format(proc.pid))
Github repository about-python, path: /standard-library/subprocess/Popen/start-gvim.py
See also this stackoverflow answer

check_output

check_output runs a command and returns the command's output.
>>> print(subprocess.check_output('xclip -o', shell=True).decode('utf8'))

See also

standard library

Index