当我从命令行停止使用net stop [something]
的WinXP服务时,它会停止而不会出现错误。但是,当我用Python这样做时:
import subprocess
stop_args = ['net', 'stop', 'TagNet.OPC.DEP']
subprocess.check_call(stop_args)
我收到以下错误:
Service "TagNet.OPC.DEP" is stopping......
System error.
System error 1067
The process finished unexpectedly.
Service "TagNet.OPC.DEP" is successfully stopped.
为什么我得到System error 1067
?如何从Python中优雅地关闭服务?