python-3.x 子进程,CREATE_NO_WINDOW,属性错误:模块“subprocess”没有属性“CREATE_NO_WINDOW”

ruyhziif  于 2023-03-13  发布在  Python
关注(0)|答案(2)|浏览(258)

当我尝试做:

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

qmb5sa22

qmb5sa221#

https://docs.python.org/3/library/subprocess.html在此链接中查找..你必须升级你的版本python到3.7,如果它是旧的,它解决了我

63lcw9qa

63lcw9qa2#

这些创建标志仅在windows操作系统上可用,您可能使用的是POSIX变体

相关问题