UiPath Documentation
activities
latest
false

Developer activities

Python Scope

UiPath.Python.Activities.PythonScope

A container which provides a scope for Python activities and initializes the specified Python environment.

When the Python Scope activity ends, all Python objects loaded up to that point are deleted.

Prerequisite

For Windows projects, starting with Python activity package version 1.9.0, the Python Scope activity requires you to install the.NET Desktop Runtime version 6 or higher.

Properties

Common

  • DisplayName - The display name of the activity.

Input

  • Installed Python Versions - A list of the Python installations detected on the machine. Selecting an installation automatically fills in the Path, Library path, and Target properties, and sets the Version property to Auto. If no Python installation is detected, the list is disabled. This is a design-time feature only; it does not detect installations at runtime.
  • Library path (Linux or version>3.9) - For Linux, the path to the libpython**.so library, including library name. For Windows (version > 3.9), the path to python**.dll, including library name. For Windows (version <= 3.9), leave this field empty.
  • Path - The path to the Python environment installation folder (for example, "C:\Users\<User Name>\AppData\Local\Programs\Python\Python<version>"). This field supports only strings and String variables. The path can also point to a Python virtual environment, in which case the packages installed in that environment are resolved at runtime.
  • Log Python Output to File (Diagnostic) - When enabled, the output of the Python process (stdout and stderr) is written to log files in the %LocalAppData%\UiPath\Logs\python folder on Windows, or the ~/.local/share/UiPath/Logs/python folder on Linux. Each log file is limited to 50 MB, and at most 128 log files are kept, with the oldest ones deleted first. The output is not forwarded to Orchestrator. Use this property for local diagnosis only, and leave it disabled in production to avoid accumulating log files. The default value is False.
  • Script Data Size Limit (MB) - The maximum size, in MB, of the data passed to the Python script as method arguments. If the size of the arguments exceeds this limit, an error is raised. If left empty, the default value of 25 MB is used. To work with data larger than the limit, save the data to a file and pass the file path to the script instead of the data itself. This field supports only Int32 variables.
  • Target - The Python runtime platform. Choose one of the two available options: x86 or x64.
  • Timeout - The amount of time in seconds to allow a Python script to run until it is terminated and an exception is thrown.
  • Version - A drop-down list containing that enables you to select which Python version you are using. By default, this property is set to Auto.
    Note:

    When set to Auto, this property detects only versions that are v3.5 and higher.

  • WorkingFolder - Used to specify the working folder of the scripts executing under the current scope. This field supports only String variables.

Misc

  • Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
  • Prerequisite
  • Properties
  • Common
  • Input
  • Misc

Was this page helpful?

Connect

Need help? Support

Want to learn? UiPath Academy

Have questions? UiPath Forum

Stay updated