Lines Matching refs:Popen
34 underlying :class:`Popen` interface can be used directly.
51 same as that of the :class:`Popen` constructor - most of the arguments to
56 When used, the internal :class:`Popen` object is automatically created with
62 The *timeout* argument is passed to :meth:`Popen.communicate`. If the timeout
67 The *input* argument is passed to :meth:`Popen.communicate` and thus to the
70 used, the internal :class:`Popen` object is automatically created with
87 to :class:`Popen`.
155 to :class:`Popen` and indicates that the special file :data:`os.devnull`
164 to :class:`Popen` and indicates that a pipe to the standard stream should be
165 opened. Most useful with :meth:`Popen.communicate`.
170 Special value that can be used as the *stderr* argument to :class:`Popen` and
251 To support a wide variety of use cases, the :class:`Popen` constructor (and
301 The newlines attribute of the file objects :attr:`Popen.stdin`,
302 :attr:`Popen.stdout` and :attr:`Popen.stderr` are not updated by
303 the :meth:`Popen.communicate` method.
326 detail in the :class:`Popen` constructor documentation.
329 Popen Constructor
333 the :class:`Popen` class. It offers a lot of flexibility so that developers
338 .. class:: Popen(args, bufsize=-1, executable=None, stdin=None, stdout=None, \
349 :class:`Popen` are as follows.
381 Popen(["/usr/bin/git", "commit", "-m", "Fixes a bug."])
399 >>> p = subprocess.Popen(args) # Success!
431 itself. That is to say, :class:`Popen` does the equivalent of::
433 Popen(['/bin/sh', '-c', args[0], args[1], ...])
655 Popen objects are supported as context managers via the :keyword:`with` statement:
659 with Popen(["ifconfig"], stdout=PIPE) as proc:
662 .. audit-event:: subprocess.Popen executable,args,cwd,env subprocess.Popen
664 Popen and the other functions in this module that use it raise an
665 :ref:`auditing event <auditing>` ``subprocess.Popen`` with arguments
673 Popen destructor now emits a :exc:`ResourceWarning` warning if the child
677 Popen can use :func:`os.posix_spawn` in some cases for better
679 Popen constructor using :func:`os.posix_spawn` no longer raise an
681 with a non-zero :attr:`~Popen.returncode`.
697 A :exc:`ValueError` will be raised if :class:`Popen` is called with invalid
705 :func:`call` and :meth:`Popen.communicate` will raise :exc:`TimeoutExpired` if
729 Popen Objects
732 Instances of the :class:`Popen` class have the following methods:
735 .. method:: Popen.poll()
738 :attr:`~Popen.returncode` attribute. Otherwise, returns ``None``.
741 .. method:: Popen.wait(timeout=None)
744 :attr:`~Popen.returncode` attribute.
755 Use :meth:`Popen.communicate` when using pipes to avoid that.
766 .. method:: Popen.communicate(input=None, timeout=None)
770 :attr:`~Popen.returncode` attribute. The optional *input* argument should be
780 the Popen object with ``stdin=PIPE``. Similarly, to get anything other than
792 proc = subprocess.Popen(...)
808 .. method:: Popen.send_signal(signal)
821 .. method:: Popen.terminate()
828 .. method:: Popen.kill()
836 .. attribute:: Popen.args
838 The *args* argument as it was passed to :class:`Popen` -- a
843 .. attribute:: Popen.stdin
852 .. attribute:: Popen.stdout
862 .. attribute:: Popen.stderr
873 Use :meth:`~Popen.communicate` rather than :attr:`.stdin.write <Popen.stdin>`,
874 :attr:`.stdout.read <Popen.stdout>` or :attr:`.stderr.read <Popen.stderr>` to avoid
879 .. attribute:: Popen.pid
887 .. attribute:: Popen.returncode
897 Windows Popen Helpers
908 structure is used for :class:`Popen` creation. The following attributes can
952 :class:`Popen` is called with ``shell=True``.
967 :func:`os.set_handle_inheritable` when passed to the :class:`Popen`
1024 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1032 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1039 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1046 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1053 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1060 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1067 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1078 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1085 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1093 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1103 A :class:`Popen` ``creationflags`` parameter to specify that a new process
1121 return the :attr:`~Popen.returncode` attribute.
1131 same as that of the :class:`Popen` constructor - this function passes all
1163 same as that of the :class:`Popen` constructor - this function passes all
1274 p1 = Popen(["dmesg"], stdout=PIPE)
1275 p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
1332 pid = Popen(["/bin/mycmd", "myarg"]).pid
1344 Popen([path] + args[1:])
1350 Popen(["/bin/mycmd", "myarg"], env={"PATH": "/usr/bin"})
1361 p = Popen(cmd, shell=True, bufsize=bufsize,
1371 p = Popen(cmd, shell=True, bufsize=bufsize,
1381 p = Popen(cmd, shell=True, bufsize=bufsize,
1393 process = Popen(cmd, stdin=PIPE)
1412 p = Popen("somestring", shell=True, bufsize=bufsize,
1420 p = Popen(["mycmd", "myarg"], bufsize=bufsize,
1425 :class:`subprocess.Popen`, except that:
1427 * :class:`Popen` raises an exception if the execution fails.
1434 ``close_fds=True`` with :class:`Popen` to guarantee this behavior on
1450 Execute the string *cmd* in a shell with :meth:`Popen.check_output` and
1474 :attr:`~Popen.returncode`.