Testing Python-script statements

While developing a Python script, you can test Extreme operating system calls by entering them in the device Python command shell. After the script is stable, you copy it to the device and then test it further by running it from the command line.

Procedure

  1. In privileged EXEC mode, enter the python command to access the Python shell.
    device# python
    Python 3.5.2 (default, Apr 11 2019, 13:05:18) 
    [GCC 4.8.2] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    Note that the device# prompt changed to a >>> Python prompt:
  2. Enter the script statements one at a time, verifying that they run as expected.
    >>> cmd_config_ve = CLI('configure \n interface ve 101-103')
    !Command: configure 
     interface ve 101-103
    !Time: Mon Aug 22 16:53:13 2019
  3. Make corrections as needed.