[Python] Execute
Q100090: [Python] Execute
Runs a Python file or command(s). Requires the installation of a Python runtime environment if not already installed.
Parameter | In/Out | Description | Other Info |
---|---|---|---|
Command to execute | In | Python command to run. | |
File to execute | In | Python file to execute. | |
Options | In | Python command line switches. | |
Arguments | In | Python arguments. | |
Log output level | In | Choices: Minimal , Verbose The level of execution detail you want to appear in the log. |
Default: Minimal |
ExitCode | Out | The exitcode returned by the process. | |
OutputText | Out | The output text created by the process. | |
Error | Out | The error reported by the process, if any. |
(Italics = required parameter)
Notes
The [Python] Execute
module is built to allow a quick and easy way to execute a Python script (.py) as a step in a job definition. Since the Python runtime is not an intrinsic component to Microsoft Windows, the use of this module will require the installation of a third-party package in order to be of use. To install a compatable Python runtime, install the python environment made available from the Python Software Foundation. When this package has been installed on the JobServer.NET server, the [Python] Execute
module knows how to locate and utilize the package. All that is necessary is to install the standard python runtime package for Microsoft Windows.
There are two primary ways to run your Python code or scripts with the [Python] Execute
module. The difference is only determined by if you just have a small number of Python commands you with to execute, or if you have a file full of Python code. If you just have a few commands to run, then you can insert them into the Command to execute
parameter. This parameter can take a list of commands, but each command must be separated by at least a newline character. This is basically the same requirement that a file, or script, would also have. The other option would be to provide the fully qualified path and filename to a Python script using the File to execute
parameter. Only one of the Command to execute
or the File to execute
parameters should be provided.
The Options
parameter allow you to specify additional command line switches to the Python runtime environment.
The Arguments
parameter allow you to specify any/optional command line switches to the Python script. If the script does not require parameters, then this should be left blank. Otherwise, any parameters that the script may be looking for can be added here.