Я оставляю пример определения задания, вы можете проверить, как получить содержимое, имя файла и путь:
Python сценарий:
import os
# content
os.system('cat @file.myfile@')
print("\n")
print("file name:")
print ("@file.myfile.fileName@\n")
print("file path:")
print("@file.myfile@")
Определение задания:
<joblist>
<job>
<context>
<options preserveOrder='true'>
<option name='myfile' type='file' />
</options>
</context>
<defaultTab>nodes</defaultTab>
<description></description>
<executionEnabled>true</executionEnabled>
<id>b1d6e1e1-15e9-40c6-b6a9-317f31910fd0</id>
<loglevel>INFO</loglevel>
<name>PythonTEST</name>
<nodeFilterEditable>false</nodeFilterEditable>
<plugins />
<scheduleEnabled>true</scheduleEnabled>
<sequence keepgoing='false' strategy='node-first'>
<command>
<fileExtension>.py</fileExtension>
<script><![CDATA[import os
# content
os.system('cat @file.myfile@')
print("\n")
print("file name:")
print ("@file.myfile.fileName@\n")
print("file path:")
print("@file.myfile@")
]]></script>
<scriptargs />
<scriptinterpreter>/usr/bin/python3</scriptinterpreter>
</command>
</sequence>
<uuid>b1d6e1e1-15e9-40c6-b6a9-317f31910fd0</uuid>
</job>
</joblist>
Пример файла «lipsum»:
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
И здесь результат.