OverView
Overview
A Python library is a library that runs .py files.
You can run the py file in the environment where Python is installed.
The package imported from the py file must be installed for normal operation.
The functions available in the Python library are:
ExecutePythonFile
You can refer to the sample for the Python library using the designer or Windows Explorer.
• Designer path: Menu > Help > Sample > Python
• windows explorer path: C:\Users\user\AppData\Roaming\Brity RPA Designer\samples\Python
[Python sample project name and related libraries]
• Python_Sample: ExecutePythonFile
Installing the Python library
For installing the Python library, refer to page 5. Installing Add-In Library.
Close both BrityRPA Designer and Bot before installation.
Common Properties
Common Properties
MORE OPTIONS
Properties | Type | Required | Unit | Auto-setting | Description |
---|---|---|---|---|---|
On Error | Combination box | N | - | N | Specify an action to carry out when an error occurs at the time of execution. - If not specified: Output errors and exit the task. - --Ignore--: Ignore the error. - --Retry--: Try the activity one more time. - --Goto--: Try the scenario for the specified time if the activity fails. - _Event: Select an event created within the project. |
DESCRIPTION
Properties | Type | Required | Unit | Auto-setting | Description |
---|---|---|---|---|---|
Description | Text | N | - | N | Add a description for the activity card. If a Description is entered, it is displayed in the description of the corresponding activity in the flowchart. If there is no Description, a representative value is displayed in the description of the activity. |
ExecutePythonFile
ExecutePythonFile
Overview
Executes the specified py file.
Application Procedures
Enter the path of the py file to be executed in FilePath.
In Arguments, specify the arguments to be input to the py file.
Specify the maximum execution time of py in Timeout(ms).
Card properties
Properties | Type | Required | Unit | Auto-setting | Description |
---|---|---|---|---|---|
FilePath | Text | Y | - | N | Enter the path to the py file to run. |
Arguments | Text | N | - | N | Specifies the arguments to be entered in the py file. |
Timeout(ms) | Interger | Y | - | Y | py Specifies the maximum execution time. Forces execution to end after a specified amount of time. |
- | - | - | - | Python library common properties. | |
- | - | - | - | Python library common properties. |
Example of utilization
Executes the specified py file.
source code(test.py)
import sys
def test():
print("my name is", sys.argv[1], sys.argv[2])
test()
Sample file
Menu > Help > Samples > Sample > Python > Python_Sample
Used properties
FilePath = Global.ResourcesDir + 'test.py'
Arguements = 'Brity RPA'
Timeout(ms) = 10000
Example of utilization
Execution will fail if LogisticRegression package is not installed.
source code(test2.py)
from sklearn.linear_model import LogisticRegression
clf = LogisticRegression()
Sample file
Menu > Help > Samples > Sample > Python > Python_Sample
Used variables
FilePath = Global.ResourcesDir + 'test2.py'
Arguements = ''
Timeout(ms) = 10000