Users Guide

Table Of Contents
Dell EMC Networking Python Support 1729
49
Dell EMC Networking Python
Support
Dell EMC Networking switches support installation and execution of Python
applications. Python applications that are to be executed on the switch must
be developed and tested offline to the maximum degree possible. The switch
does not offer interactive shell access for development of Python scripts, nor
does the Dell EMC Networking switch come with all of the normal Python
“batteries included” modules. A list of the included packages is in the
example below. Output from Python scripts is sent to the serial console, so a
serial connection is mandatory when developing scripts.
Input from the console is not supported, e.g. raw_input() is not
supported. This means that interactive Python applications are not suitable
for use in the switch environment.
An example Python script that prints some useful information is shown
below. Explanation of Python syntax is beyond the scope of this document.
Refer to the 2.7.10 version of Python documentation available elsewhere.
#!/usr/bin/env python
import sys
print "Hello World!\n"
print (sys.version)
help('modules')
To execute this script on the switch, save the lines above in a file named
"app". Package the app script using the following commands on a Linux
system. The package may be a gzipped tarball with a .tgz or .tar.gz extension.
It is required that the permissions be set on the app file prior to packaging;
i.e., user read, write, and execute must be set. Group and other permissions
need not be set. Application names can be a maximum of 15 characters.
/home/jmclendo/tftpboot>chmod u+rwx app
/home/jmclendo/tftpboot>tar czf app.tgz app