发布于 2012-04-26 09:33:19
_subprocess似乎是一个特定于Windows的C扩展模块,它实现了subprocess模块本身使用的一些功能。如果看一下in the source for subprocess,就会发现_subprocess只在if mswindows块内部引用。
这是实现的一个细节,所以你绝对不应该在任何实际的代码中使用它(当然,一些好奇心从来不是一件坏事)。
Here's the source for `_subprocess'。顶部的评论说
* 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.发布于 2012-04-26 09:33:09
它是一个实现细节,在Windows上存在,但不存在(例如)在Unix系统上。你不应该使用它。
发布于 2012-04-26 12:00:28
与Python中以下划线开头的其他名称一样,此类模块通常不会直接使用。通常,应该使用不带下划线的模块,subprocess就是这种情况。
这通常用于将模块实现划分为用C和纯Python编写的部分。加下划线的模块是用C语言编写的,并在“其上”添加了一个纯Python模块,以提供高级API。
https://stackoverflow.com/questions/10326087
复制相似问题