Jump to content

Running Python Scripts From AutoIt


Go to solution Solved by Danp2,

Recommended Posts

Posted

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.
Link:

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.

Posted

Yeah, there’s no reason to compile it to an EXE unless you have something that really requires that that I can’t imagine

My resources are limited. You must ask the right questions

 

Posted

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?

Posted

Is python installed where you’re trying to execute this? Willa call to the python interpreter be found in the path of the test environment 

My resources are limited. You must ask the right questions

 

Posted
On 12/29/2022 at 4:46 PM, Earthshine said:

Are you running as administrator.

Yes, I am

On 12/29/2022 at 7:03 PM, Danp2 said:

Please post the code showing what you tried.

all the snippets I tried are in that thread.

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...