-1
我无法通过子程序在python中启动和停止服务。得到错误像无法通过python中的子进程启动和停止服务
Traceback (most recent call last):
File "subProcessExample.py", line 3, in <module>
p = Popen(["C:/Program Files/Apache Software Foundation/Tomcat8.0/bin", service, "stop"], stdin=PIPE, stdout=PIPE, stderr=PIPE)
File "C:\Python27\lib\subprocess.py", line 679, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
startupinfo)
WindowsError: [Error 5] Access is denied
请张贴更易读的回溯。把它放在代码块中,这样行就不会被包装。 – Barmar
错误消息似乎很明显:您正试图运行一个程序,但您没有适当的权限。你需要用root来停止和启动服务。 – Barmar