noellarkin Posted December 25, 2022 Posted December 25, 2022 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.
Danp2 Posted December 25, 2022 Posted December 25, 2022 Can't you run the script using the Python interpreter without compiling to exe? Earthshine 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Earthshine Posted December 26, 2022 Posted December 26, 2022 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
noellarkin Posted December 28, 2022 Author Posted December 28, 2022 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?
Earthshine Posted December 28, 2022 Posted December 28, 2022 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
noellarkin Posted December 29, 2022 Author Posted December 29, 2022 Yes it is, albeit it's Python x64 (not sure if that may be a factor). When using Cmd directly, I'm able to run the Python interpreter.
Earthshine Posted December 29, 2022 Posted December 29, 2022 (edited) Are you running as administrator. Edited December 29, 2022 by Earthshine My resources are limited. You must ask the right questions
Danp2 Posted December 29, 2022 Posted December 29, 2022 23 hours ago, noellarkin said: Doesn't seem to be running when I use the .py file. Please post the code showing what you tried. Earthshine 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
noellarkin Posted December 31, 2022 Author Posted December 31, 2022 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.
Solution Danp2 Posted December 31, 2022 Solution Posted December 31, 2022 My crystal ball says that the error is somewhere in your code. 😏 SOLVE-SMART and noellarkin 1 1 Latest Webdriver UDF Release Webdriver Wiki FAQs
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now