A feature of A2019 is that you can call Python or VBScript or write inline. There is something like that. This time, various easy-to-use libraries such as data analysis, machine learning, image analysis, etc. are prepared. Here's how to run Python from A2019.
The Python code itself is very simple this time, displaying arbitrary messages in a message box. However, if it works, please try various things.
PC with Automation Anywhere A2019 Community Edition set up
I've written a lot of things in a mess, but to put it simply, this is all I have to do.
Set up Python Set on the Windows side (pass Path to Python.exe) A2019 Make a bot Execute
Either ver2 series or 3 series is okay. (I dropped ver 3.8.)
Welcome to Python.org https://www.python.org/
All you have to do is start the executable file and follow the instructions.
Set so that Python can be started just by typing "Python" at the command prompt.
There are similar lists on the top and bottom, but if you apply only to the currently logged in user, the top, If you want to apply it to all users registered on the PC, find the item "Path" in the list below and open it.
The environment variable "Path" setting dialog opens. Click "New" in the menu on the right. Enter the path of the folder where Python.exe is installed. In my environment, it was installed in the following path. C: \ Users \ username \ AppData \ Local \ Programs \ Python \ Python38-32
Open a command prompt. (The quick way is to type Win + r-> cmd and enter.) When the command prompt opens, type "Python" and press Enter. If the following display is displayed, it is successful.
When you're ready, let's actually run the Python code in A2019.
Find Python Script in the menu on the left and open the tree. (You may search.)
Python Script: Open Python Script: Execute script Python Script: Close Drag and place the actions in this order.
I feel like this.
Python Script: Open only Try setting as follows. Other actions can be left as they are this time.
The Python code is below.
SimpleMessageBox.py
from tkinter import messagebox
messagebox.showinfo('Python GUI', 'message')
This time I selected Manual input and wrote the Python code directly, You can also call a Python source file with a .py extension by choosing Import existing file.
The Python runtime version is as you see it, but if the Python version is 2 series, select 2 or 3 if it is 3 series. Since I am using ver 3.8.0 this time, I have selected "3".
After completing the settings, press the save button. (Don't forget to press the "Apply" button on each node.)
If you press the execute button and the following message box is displayed, it is successful ☆ 彡
Not only those who originally use Python, but also those who are new to this time can do various things with Python, so Please take this opportunity to try various things.
Recommended Posts