SR OS supports both Python2 and Python3 for Python scripts. Python3 only supports python-policy.
The SR OS Python2 script support is based on Python version 2.4.2. Python2 has a set of language features (such as functions, lists, and dictionaries) and a large set of packages that provide most of the Python2 functionality. The SR OS keeps the language features intact and reduces the number of packages available to provide the operator with a small, but flexible, scripting language. The APIs described in this user guide are Python2 APIs.
The only feature removed from the Python2 language is unicode support. The only packages provided to the operator are:
alc
The SR OSThe SR OS-provided packages provide access to various ESM objects such as DHCPv4, DHCPv6, or RADIUS packets.
binascii
The binascii package contains common ASCII decoding, like base64.
re
The re package contains regular expression support.
struct
The struct package parses and manipulates binary strings
.md5
The MD5 package provides the MD5 message digest algorithm.
The MD5 package provides the MD5 message digest algorithm.
The SR OS Python3 script support is based on MicroPython version 3.4. Even though the majority of Python3 TPSDA APIs are similar to Python2 TPSDA API, there are some differences. For details about the Python3 TPSDA API, see SR BNG TPSDA Python3 API.
In addition to Python3 TPSDA API, the following Python3 libraries are also available:
uarray
ubinascii
ucollections
uhashlib
uio
ure
ustruct
utime (Nokia modified the implementation of this module. For usage information, see Nokia pySROS API.)
Standard libraries:
datetime
ipaddress
sys