setup:

tested on: oracle virtual box, h3c cloud lab

the snapshot is taken from the h3c cloud workspace, all 3 devices are connected to the virtual box host only adapter

the diagram on h3c cloud lab shows 3 hosts, but logically its the same host connecting to 3 devices

ip address as follows:
host: 192.168.56.1/24
device1: 56.11/24
device2: 56.12/24
device3: 56.13/24

comware devices are configured with the same local user and super credentials

input:
given on a separate python file named d.py, stored in the same folder

#code

d

main script:

all the import statements would by standard, come at the top of the code, in this code, the import statements are used in various parts, to understand it's significance in that section

test_script

demo:
–end-of-document–