Libraries
When calling for library there is different way of doing this . import re Then you need to specify the re.search to be able to use the search function. from re import search Then no need to use the re.search…
Read more
Network Engineer – F.O.C.U.S Follow One Course Until Successful
When calling for library there is different way of doing this . import re Then you need to specify the re.search to be able to use the search function. from re import search Then no need to use the re.search…
Read more
This is the methods available for CiscoConfParse : find_all_children(linespec, exactmatch=False, ignore_ws=False) Returns the parents matching the linespec, and all their children. This method is different than find_children(), because find_all_children() finds children of children. find_children() only finds immediate children. Parameters linespecstr Text regular expression for the line to…
Read more
CiscoConfParse is a library for Cisco device. : pip install ciscoconfparse Example : from ciscoconfparse import ciscoconfparse Cisco_obj = CiscoConfParse(“show_run.txt”) print(Cisco_obj) <—- this will return all the information about that object If using Netmiko to pull information from any device into a…
Read more
This is going to be a example how to create a new dictionary out of an output : 1st the dictionary that we are going to change with only specific items with different key names : from pprint import pprint…
Read more
To work with data structure you can drill down to which information you need using these commands to peel it layer by layer : 1st determine what kind of data : List : output.keys() type(output) len(output) Then to see the…
Read more
To import a library in python you need to specify it in the beginning of the script file : import “library” example pprint is a library for an easy reading output. to see where that library is install : “library”.__file__…
Read more
Hey Ben ! : See below the install Linux and Windows for me details how to : —— LINUX —– Install : apt-get update apt install python3-virtualenv cd ~ cd VENV virtualenv virtualenv-3.6 -p /usr/bin/python36 “virtual env name” ll or…
Read more
import sys sys.path Every time you are importing a package “netmiko” this is where it is going to look for it. to remove the default path for python : env | grep PYTH unset PYTHONPATH env | grep PYTH cat…
Read more