How to script an OLE component using Python

前端 未结 5 1072
無奈伤痛
無奈伤痛 2020-12-10 05:39

I would like to use Python to script an application that advertises itself as providing an OLE component. How should I get started?

I don\'t yet know what methods I

5条回答
  •  无人及你
    2020-12-10 06:24

    You need the win32com package. Some examples:

    from win32com.client.dynamic import Dispatch
    
    # Excel
    excel = Dispatch('Excel.Application')
    
    # Vim
    vim = Dispatch('Vim.Application')
    

    And then call whatever you like on them.

提交回复
热议问题