Filip
Filip

Reputation: 1007

How to call an AutoIt script in Python

How can I call an AutoIt EXE file to Python code?

I need add to code which were generated by a Selenium AutoIt script.

Upvotes: 2

Views: 9521

Answers (1)

Vader
Vader

Reputation: 3873

If you want to just run the AutoIt script then use os.system or os.popen and take a look at the page Running Scripts. If you want to call AutoIt methods from your Python script then:

  1. Register AutoItX3.dll in your system: regsvr32 AutoItX3.dll
  2. Install PyWin32
  3. Use AutoIt from your code as follows:

    import win32com.client
    
    autoit = win32com.client.Dispatch("AutoItX3.Control")
    
    autoit.AnyAutoitMethod()
    

Upvotes: 5

Related Questions