There is a module called _subprocess
, as seen in that question.
I was able to import it, but I haven't found any documentation about what is it and how it is different from subprocess
.
Anybody here know what this module does?
There is a module called _subprocess
, as seen in that question.
I was able to import it, but I haven't found any documentation about what is it and how it is different from subprocess
.
Anybody here know what this module does?
_subprocess
seems to be a Windows-specific C extension module that implements some of the functionality that's used by the subprocess
module proper. If you look in the source for subprocess
, _subprocess
is only referred to inside of if mswindows
blocks.
It's a detail of the implementation, and so you definitely shouldn't use it in any actual code (though of course some curiosity is never a bad thing).
Here's the source for `_subprocess'. The comment at the top says
* support routines for subprocess module
*
* Currently, this extension module is only required when using the
* subprocess module on Windows, but in the future, stubs for other
* platforms might be added here as well.
It's an implementation detail, present on Windows but not (e.g.) on Unix systems. You are not supposed to use it.
As with other names in Python starting with an underscore, such modules are usualy not meant to be used directly. Usually there is a module without the underscore that should be used instead, as is the case with subprocess
.
This is often used to divide module implementation into parts coded in C and pure Python. The underscored module is written in C and a pure Python module is added "on top of it" to provide a high level API.