ID EN
OS

popen

Python 3.11

Open a pipe to or from command cmd. The return value is an open file object connected to the pipe, which can be read or written depending on whether mode is 'r' (default) or 'w'. The buffering argument have the same meaning as the corresponding argument to the built-in open() function. The returned file object reads or writes text strings rather than bytes.

Syntax

PYTHON
os.popen(cmd, mode='r', buffering=-1)

See Also

open() None waitstatus_to_exitcode() subprocess.Popen Availability Python UTF-8 Mode popen() subprocess.Popen