activities
latest
false
Developer Activities
Last updated Oct 22, 2024

Run Python Script

UiPath.Python.Activities.RunScript

Enables you to execute Python code. You can input the code directly in the activity or provide a file path for it.

It 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 activity package as the run directory for the script.

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>

Properties

Common
  • DisplayName - The display name of the activity. This field supports only String variables.
Input
  • Code - The Python code that you want to run. This field supports only String variables.
  • File - The path to the file containing the Python code that you want to run. This field supports only String variables.
Misc
  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
  • 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.