Run Python Activity

Description

The Run Python activity runs a Python script on the server.

Depending on the Python script specified, an array of input arguments to the script may be required.

This activity requires Python to be installed on the server.

Python must be installed for all users. If the Run Python activity fails when other users run the workflow, make sure Python was installed using an all-users installation. For more information, refer to the Python documentation.

Usage

A workflow in a client application could use the Run Workflow activity to run a server workflow. The server workflow could use the Run Python activity to perform a computation, business operation, or some other analysis using a Python script, followed by a Set Workflow Output activity to return the result of the Python script to the client application. Finally, the client application could use the Python result to update the application or present information to the end user.

Inputs

Python File

Required

Type: String

The path of the Python script (.py) file on the server.

Arguments

Optional

Type: String[]

The list of arguments to pass to the Python script.

Timeout

Optional

Type: Number

The time span in milliseconds to wait for the Python script to complete. The default is 60000 (one minute).

Outputs

result

Type: String

The text output of the Python script.

success

Type: Boolean

Whether the Python script completed successfully.

error

Type: String

Any error messages written by the script.

exitCode

Type: Number

The exit code returned by the script. An exit code other than zero usually indicates a failure.

Properties

For information about the ID, Display Name, and Description properties, see Properties Common to all Activities.

Supported Environments

Environments capable of running this activity

Server

 

Client

Geocortex Web

Geocortex Mobile

Geocortex Viewer for HTML5

Web AppBuilder

Levels of Support:      Full Support      Partial Support      No Support

Offline Support

This activity does not work when the device is offline.

See also...

https://www.python.org