set python

Purpose

Configures Python programs to execute when the Digi device boots.

Required permissions

For Digi products with two or more users, to use this command, permissions must be set to set permissions s‑python=read to display settings, and set permissions s‑python to display and configure settings. See set permissions for details on setting user permissions for commands.

Syntax

set python [range=1–4]
[state={on|off}]
[onexit={none|restart|reboot}]
command=”program file [arguments...]”

Options

range=1 – 4

The index or indices to view or modify with the command.

state={on|off}

Enables or disables Python program autostart, or automatic execution of Python programs loaded on the Digi device when the device boots. When the state is set to on, the command specified runs when the device boots.

onexit={none|restart|reboot}

The action that should occur if the specified Python program exits.

none

No action.

restart

Restart the specified Python program.

reboot

Reboot the Digi device.

command=”program file [arguments...]”

The program filename to execute, including any arguments to pass with the program, similar to the arguments for the python command. While this option allows for programs to run from a TFTP server, this use is not recommended. If there are spaces to provide arguments, make sure to wrap the entire command in quotation marks.

Examples

#> set python range=1 state=on onexit=restart

See also

Digi's Developer Wiki is where you will learn about developing solutions using Digi's communications product, software and services. The Wiki includes how-to information, example code, and M2M information to speed application development. Digi encourages an active developer community and welcomes your contributions.

www.digi.com/wiki/developer/index.php/Main_Page