python多次调用WIM失败,解决方法
x_wmi_uninitialised_thread at /
<x_wmi: WMI returned a syntax error: you're probably running inside a thread without first calling pythoncom.CoInitialize[Ex] (no underlying exception)>
后来在网上搜索,看到必须添加初始化函数和去初始化函数
<code>
import pythoncom
import wmi
pythoncom.CoInitialize ()
c = wmi.WMI ()
#
# do things
#
pythoncom.CoUninitialize ()
</code>
学习链接:
https://bytes.com/topic/python/answers/608938-importing-wmi-child-thread-throws-error
https://www.baidu.com/link?url=B5abgKIN6BuQtB0JEulod3HFD2MPtxU-UN_c7DSCihXJ_0aI3ugXuX5jy8xxR0kBoVg75aqgUDnU-NLcvWgcYs1SEFPOJ7S86bhDNoXFTEm&wd=&eqid=ecd0c574000392c60000000258f70637
posted on 2017-04-19 14:51 zhangxiaolan 阅读(1522) 评论(0) 收藏 举报
浙公网安备 33010602011771号