activities
latest
false
- 概述
- 加密
- 数据库
- Java
- Python
- 网页 API
开发者活动
上次更新日期 2026年4月21日
UiPath.Python.Activities.RunScript
使您能够执行 Python 代码。您可以直接在活动中输入代码或为其提供文件路径。
只能在“Python 作用域”活动中使用。
出于软件限制,默认情况下,此活动使用 Python 活动包的安装位置作为脚本的运行目录。
为了能够在脚本中使用相对路径,您可以将以下代码添加到加载的脚本中:
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>
属性
常见
- DisplayName - The display name of the activity. This field supports only
Stringvariables.
输入
- Code - The Python code that you want to run. This field supports only
Stringvariables. - File - The path to the file containing the Python code that you want to run. This field supports only
Stringvariables.
其他
- “私有”- 选中后将不再以“Verbose”级别记录变量和参数的值。