我无法在Python2.7.2中使用spawnlp

2024-05-20 03:43:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我在玩利用os.spawnlpentangled。我目前运行的是python2.7.2。在

这是我得到的错误。在

Traceback (most recent call last): File "create_network.py", line 47, in nodes.append(os.spawnlp(os.P_NOWAIT, 'python', 'python py', str(startPort))) AttributeError: 'module' object has no attribute 'spawnlp'

我如何着手解决这个问题?似乎没有任何迹象表明spawnlp是在版本1.6中首次添加后被删除的。在

我已经重新下载了windows python安装程序,并使用修复选项运行了它。我唯一能想到的可能是这台计算机是64位的,而python版本是32位的。。。我不认为这是问题,但这是我唯一能想到的。。。在

最后,its recommended to use the subprocess module rather than the os.spawn*


Tags: thepy版本利用mostos错误call
1条回答
网友
1楼 · 发布于 2024-05-20 03:43:03

python documentation中,它声明

spawnlp(), spawnlpe(), spawnvp() and spawnvpe() are not available on Windows. spawnle() and spawnve() are not thread-safe on Windows; we advise you to use the subprocess module instead

实际上,您必须使用另一个模块来创建子流程。在

相关问题 更多 >