请问下python 获取系统服务状态的方法

请教下python 获取系统服务状态的方法请教下python 获取系统服务状态的方法?[解决办法]Python codedef lis

请教下python 获取系统服务状态的方法
请教下python 获取系统服务状态的方法?

[解决办法]

Python code
def listservices():    import wmi        c = wmi.WMI()    for service in c.Win32_Service():        print service.Caption,service.StartMode,service.State        if __name__=='__main__':    listservices()
[解决办法]
360主动防御服务有中文,如果你保存为utf8格式,这样一下显示中文服务名出来:
print service.Caption.encode('gbk'),service.StartMode,service.State