【发布时间】:2018-11-25 06:37:23
【问题描述】:
我是 python 新手,正在使用 Visual Studio 代码,我还安装了 pywin32。但是,当我运行程序时,它说 pythoncom 模块没有 CoInitialize 和 CoUninitialize 成员。
我想知道如何让 pythoncom 识别这两个成员?
import os
if os.name == 'nt':
import pythoncom
class PlatformHelper:
def __init__(self):
if os.name == 'nt':
pythoncom.CoInitialize()
def __del__(self):
if os.name == 'nt':
pythoncom.CoUninitialize()
if __name__ == "__main__":
print ("roypy_platform_utils is a utility module, it doesn't expect to be run directly")
【问题讨论】: