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
- python to execute Python programs.
- revert: The revert python command reverts the settings configured by this command.
- who to view which Python threads are running. Python threads are listed for informational purposes. They cannot be killed with either the kill command or via the Management > Connections page in the web interface.
- The Digi Python Programming Guide to learn more about the Python programming language as implemented in Digi products, and writing Python programs. This guide is available on the Digi website at:
www.digi.com/wiki/developer/index.php/Digi_Python_Programmer's_Guide - The Digi Developer Community Wiki is a place to learn about developing solutions using Digi's communications portfolio, software and services, including Python, Remote Manager, DIA, and more.
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.
- The Python Support Forum on digi.com
www.digi.com/support/forum/categories/python