Activities
latest
false
Banner background image
Developer Activities
Last updated Mar 15, 2024

Load Python Script

UiPath.Python.Activities.LoadScript

Enables you to store the handlers of a Python script in a PythonObject variable. You can use the resulting variable to invoke the methods within the code. If there is inline code besides the methods present in the script, the code is also executed at runtime. Can only be used inside the Python Scope activity.

Due to a software limitation, this activity uses, by default, the installation location of the Python activities pack as the run directory for the script. To change this, and to be able to use relative paths inside the script, you can add the following code to the loaded script as a workaround:

import sys 
import os
sys.path.append(os.path.dirname(os.path.realpath(<em>file</em>)))
import <your module here>import sys 
import os
sys.path.append(os.path.dirname(os.path.realpath(<em>file</em>)))
import <your module here>
Note: The Python Activity Pack is now compatible with .NET 6 Windows.

Properties

Common
  • DisplayName - The display name of the activity. This field supports only String variables.
Input
  • Code - The Python code that you want to load. This field supports only String variables.
  • File - The path to the file which contains the Python code that you want to load. This field supports only String variables.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
Output
  • Result - The handlers for the specified Python script, stored in a PythonObject variable.
  • Properties

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.