Python Read and Write Files

Hello Ripal

I believe the easiest way to achieve this is to use Cisco’s CLI output modifiers. You can use the show interface status | include connected command to limit the output to only the connected ports. You can create different Python functions to call different CLI commands according to the kind of output you want.

Creating a Python script to filter out the connected interfaces is possible, but it is definitely more complicated. If you want to achieve it via Python, there are many ways to do it. Some are found at the following link:

I hope this has been helpful!

Laz