Jump to content
Sign in to follow this  
kcvinu

AutoItX3 is not working in python

Recommended Posts

Hi there, 

I have installed pywin32 in my pc. And i wrote this code

>>> import win32com.client
>>> autoit = win32com.client.Dispatch("AutoItX3.Control")
>>> autoit.Run("calc.exe")
But it is showing this error message.
 
"Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    autoit.Run("calc.exe")"
Please help. Complete error message is in an image with this post. Please see attachment

post-89644-0-05149000-1421475160_thumb.p


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

Use AutoIt as intended. NOT in Python.

Seriously Bert?

@kcvinu

Try to use unicode strings:

autoit.Run(u"calc.exe")

You may need the full path though ;).

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Hi 

SmOke_N

Thanks.  Let me try.

I am afraid, most of the AutItX3 functions are not listed in the intellisense of python shell. 


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

@SmOke_N, No way. It's not working.


My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

Hi 

SmOke_N, i tried that but not installing. First of all there is no exe file for it. We need to manually type code in cmd. It says that it can;t find a directory named pyAutoit. I dropped that idea and started with pywin32. 

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Share this post


Link to post
Share on other sites

REM used WIN7+python3.7, Other situations configure yourself
::online install
::pip install pywin32
::pip install pypiwin32
::offline install
pip install pypiwin32-223-py3-none-any.whl
pip install pywin32-224-cp37-cp37m-win_amd64.whl

::copy and reigist module
copy "C:\Program Files (x86)\AutoIt3\AutoItX\AutoItX3_x64.dll"  C:\windows\system32
regsvr32 /s AutoItX3_x64.dll

#paython call 

#coding:utf-8
import win32com
import win32com.client
autoit = win32com.client.Dispatch("AutoItX3.Control")
autoit.Run("calc.exe")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...