Jump to content

Running Python Scripts From AutoIt

Go to solution Solved by Danp2,

Recommended Posts

Yesterday I wrote a quick AutoIt script that uses the EditDistance python library by first writing the .py script and then converting it to exe, then passing arguments to it from AutoIt via command line.

I use AutoIt for 90% of my work, and it's quite adequate for almost anything. However, it falls short in one area: libraries related to data processing. This is fine, I understand AutoIt wasn't built to be a language for that purpose. However, it would be interesting if AutoIt would have ways of interacting with python scripts etc so existing python libraries for data analytics etc could be used. So far, the only way I've managed to do this is:

1. Write .py script, make it accept command line arguments, and print output
2. Compile .py into an exe file
3. Write autoit script that uses Run() to execute the exe file, and catches the cmd console output in a variable.

Is this the only way to go about it? This is a little inconvenient, in that I have to compile the .py into an exe every time I make changes to the python script.

Link to comment
Share on other sites

Doesn't seem to be running when I use the .py file. I was wondering if it has something to do with the x64/x32 issue, but even setting the Pragma x64 doesn't seem to be working.
Perhaps I'll try reinstalling Python in x32 and try again.
I was also wondering if I could just pass commands to Python in REPL (python -i) so I would then just need to create a list of "Wrapper" functions in Autoit that can be used to control python in REPL. Thoughts?

Link to comment
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

  • Create New...