活动
最新
False
- 概述
- 加密
- 数据库
- Java
- Python
- 网页 API
开发者活动
上次更新日期 2024年4月23日
加载 Python 脚本
UiPath.Python.Activities.LoadScript
使您能够将 Python 脚本的处理程序存储在
PythonObject
变量中。 您可以使用生成的变量来调用代码中的方法。 如果除了脚本中存在的方法之外还有内联代码,则代码也会在运行时执行。 只能在“ Python 作用域 ”活动中使用。
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 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>
注意: Python 活动包现在与 .NET 6 Windows 兼容。