how to get attributes from win32com.client.dispatch(“Shell.Application”)

后端 未结 1 997
说谎
说谎 2021-02-10 02:10

I am trying to control my device manager programmatic through python (ie disable and re-enabling devices). However I am having trouble figuring out what are the attributes in th

相关标签:
1条回答
  • 2021-02-10 02:53

    One way to check the attributes in a COM object is using the combrowse.py available on win32com\client in your python site-packages folder

    Just run the script (double clicking or from command line/python) and a window should appear with all the available com objects. Under Registered Type Libraries you should find the Shell under the correspondent Library in Microsoft Shell Controls And Automation
    You can check this with the following command in python:

    from win32com.client import gencache
    shell = gencache.EnsureDispatch('Shell.Application')
    print shell
    

    Also, using the gencache method, you can use Tab to check some of the available methods, but for a comprehensive list check the combrowse.py. The only issue is that some of the methods listed at the combrowse.py are not really available within python.

    0 讨论(0)
提交回复
热议问题