随笔分类 - Python
摘要:安装 从官方网站下载python程序,我下载的是python-3.3.2.msi然后下载python扩展程序,我下载的是pywin32-218.win32-py3.3.exe最后下载wmi插件,我下载的是WMI-1.4.9.win32.exe(md5)测试#测试能否使用wmi,因为停用的服务过多,所以执行此程序需要一定时间import wmic = wmi.WMI ()for s in c.Win32_Service (): if s.State == 'Stopped': print(s.Caption, s.State)
阅读全文
摘要:参考文献:http://bbs.chinaunix.net/thread-1848086-1-1.html经常地我们需要编写跨平台的脚本,但是由于不同的平台的差异性,我们不得不获得当前所工作的平台(操作系统类型)。import platformdef TestPlatform(): print ("----------Operation System--------------------------") #Windows will be : (32bit, WindowsPE) #Linux will be : (32bit, ELF) print(platform...
阅读全文