Python in SR OS overview

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:

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: