new here and new to python.
I have a configuration file of a network device and I want to print some parts of the content of that file with a python script.
I open the file with myfile = open('techsupport.txt', 'r')
but I'm not sure how to get the output from that file that includes the section of the "show version". which is more than one line of output when I did this:
- Code: Select all
showversion = "show version"
for line in myfile:
if showversion in line:
it only print the line that has show version and not the following lines.
Hopefully I am making sense and someone can help me.