当我尝试:
import subprocess
subprocess.CREATE_NO_WINDOW
我收到以下错误:
AttributeError: module 'subprocess' has no attribute 'CREATE_NO_WINDOW'
为什么会这样?子流程文档清楚地说明了以下内容。
subprocess.CREATE_NO_WINDOW¶
A Popen creationflags parameter to specify that a new process will not create a window.
New in version 3.7.
我已经安装了python 3.9.5
编辑我用的是Linux Ubuntu 21.04
https://docs.python.org/3/library/subprocess.html看看这个链接…如果python版本较旧,则必须将其升级到3.7这对我来说已经解决了
这些创建标志仅在windows
操作系统上可用,可能您是在一些POSIX变体