python
Purpose
Manually executes a Python program from the command line. The python command is similar to a command executed on a PC. However, other than a program name and arguments for the program, the command takes no arguments itself, and is currently unable to spawn an interactive session.
Required permissions
For Digi products with two or more users, permissions must be set to set permissions python-cmd=execute for a user to use this command. The python-files permission is a separate permission that controls access to Python programs in the Python directory for the Digi device, but does not impact execution of this command. See set permissions for details on setting user permissions for commands.
Syntax
python [(TFTP server ip):]filename [program arguments...]
Options
[(TFTP server ip):]filename
The main file to be executed. This file can be either a file on the file system accessed through the Web UI, or a file accessible through a TFTP server on the network. This TFTP functionality reduces the number of times that you may need to place a program on the file system while developing and refining functionality. However, the TFTP behavior only works for the main program. Modules and packages must still be present on the file system to be used.
program arguments...
Arguments to be supplied to the program, as needed.
Example
#> python EmbeddedKitService.py
#> py dia.py
See also
- set python to manually execute a Python program.
- who: The who command can be used 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 Developer Community Wiki: this is a place to learn about developing solutions using Digi's communications portfolio, software and services, including Python, Remote Manager, DIA, and more.
- Digi Python Custom Development Environment page:
http://www.digi.com/technology/drop-in-networking/python.jsp
- The Digi Python Programming Guide. This guide introduces the Python programming language by showing how to create and run a simple Python program. It reviews Python modules, particularly modules with Digi-specific behavior. It describes how to load and run Python programs onto Digi devices, either through the command-line or web user interfaces, and how to run several sample Python programs. Find this guide on the Digi website at https://www.digi.com/wiki/developer/index.php/Digi_Python_Programmer's_Guide.
- The Python Support Forum on digi.com: Find answers to common questions and exchange ideas and examples with other members of the Digi Python development community at: