JS7 can be used to execute any scripts, executables and programs including Python® scripts.
- Python® is a frequently used scripting language available for Linux, MacOS, Windows and other platforms.
- This article explains how to syntactically include Python® scripts with JS7 job scripts.
- Find examples for download (.json upload): pdScriptingPythonUnix.workflow.json
In order to directly add Python® script code to a JS7 shell job script the recommended approach is to use a shebang like this:
Alternatively a Python® script can be executed from a file that has to be located by the executing Agent:
- Find examples for download (.json upload): pdScriptingPythonWindows.workflow.json
In order to directly run Python® script code from a JS7 shell job script the recommended approach is to use a shebang replacement like this:
- Credits for the shebang replacement to How to run a PowerShell script within a Windows batch file
- If you consider this shebang replacement somewhat cryptic then add it to JS7 - Script Includes which are easily referenced from shell jobs, e.g. by using
python.exeexecutable is available when Python® is installed for Windows.
Alternatively a Python® script can be executed from a file that has to be located in reach of the Agent: