Starting to figure it out how python syntax is working and how we can use internal libraries to connect to switches.

Let’s take the telnetlib

Here is a short example of connecting to switch and changing it’s hostname.

telnet_connect

Example of script was taken from telnetlib: https://docs.python.org/2/library/telnetlib.html 

Great free content to learn the Python and Networking automation