Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

17.4.1 Popen3 and Popen4 Objects


17.4.1 Popen3 and Popen4 Objects

Instances of the Popen3 and Popen4 classes have the following methods:

poll( )
Returns -1 if child process hasn't completed yet, or its return code otherwise.

wait( )
Waits for and returns the status code of the child process. The status code encodes both the return code of the process and information about whether it exited using the exit() system call or died due to a signal. Functions to help interpret the status code are defined in the os module; see section 14.1.5 for the W*() family of functions.

The following attributes are also available:

fromchild
A file object that provides output from the child process. For Popen4 instances, this will provide both the standard output and standard error streams.

tochild
A file object that provides input to the child process.

childerr
A file object that provides error output from the child process, if capturestderr was true for the constructor, otherwise None. This will always be None for Popen4 instances.

pid
The process ID of the child process.

See About this document... for information on suggesting changes.
Microsoft publie l'édition de juin 2019 de l'extension Python pour Visual Studio Code, elle inclut 70 correctifs et son lot de nouveautés
Le neuvième week-end de programmation de jeux vidéo sur Developpez.com
Programmation : une étude révèle les langages les plus voraces en énergie, Perl, Python et Ruby en tête, C, Rust et C++, les langages les plus verts
Apprendre les notions avancées en Cython, un tutoriel de Gabor Laszlo Hajba traduit par l'équipe de rédaction
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web