activities
latest
false
- 概述
- 加密
- 数据库
- Java
- Python
- 网页 API

开发者活动
上次更新日期 2024年12月11日
加载 Python 脚本
UiPath.Python.Activities.LoadScript
使您能够将 Python 脚本的处理程序存储在
PythonObject
变量中。
您可以使用生成的变量来调用代码中的方法。如果除脚本中存在的方法外还存在内联代码,则系统也会在运行时执行这些代码。
只能在“Python 作用域”活动中使用。
出于软件限制,默认情况下,此活动使用 Python 活动包的安装位置作为脚本的运行目录。
为了能够在脚本中使用相对路径,您可以将以下代码添加到加载的脚本中:
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath(file)))
import
import sys
import os
sys.path.append(os.path.dirname(os.path.realpath(<em>file</em>)))
import <your module here>