我正在尝试解释开关的以下输出。基本上我希望它通过输出直到找到“notconnect”然后将接口的名称存储在一个数组中。然后继续通过文件并将下一个“notconnect”接口存储为数组中的下一个元素。以下示例中的接口为 Gi1/0/4。我只是不确定从哪里开始。任何帮助,将不胜感激。我正在使用 Python 3.3.2。
b'\r\n\r\nMS-2673-DC-CS01#terminal length 0\r\nMS-2673-DC-CS01#sh interface status\r\n\r\nPort Name Status Vlan Duplex Speed Type\r\nGi1/0/1 Connection to MS-2 connected trunk a-full a-1000 1000BaseSX SFP\r\nGi1/0/2 Connection to MS-2 connected trunk a-full a-1000 1000BaseSX SFP\r\nGi1/0/3 Connection to MS-2 connected trunk a-full a-1000 1000BaseSX SFP\r\nGi1/0/4 notconnect trunk auto auto Not Present\r\nGi1/0/5 Connection to MS-2 connected trunk a-full a-1000 1000BaseSX SFP\r\nGi1/0/6 Connection to MS-2 connected trunk a-full a-1000 10/100/1000BaseTX SFP\r\nGi1/0/7 Connection to MS-2 connected trunk a-full a-1000 10/100/1000BaseTX SFP\r\nGi1/0/8 Connection to MS-2 connected trunk a-full a-1000 10/100/1000BaseTX SFP\r\nGi1/0/9 Connection to MS-2 connected trunk a-full a-1000 10/100/1000BaseTX SFP\r\nGi1/0/10 Connection to MS-2 connected trunk a-full a-1000 10/100/1000BaseTX SFP\r\nGi1/0/11 Connection to MS-2 connected trunk a-full a-1000 10/100/1000BaseTX SFP\r\nGi1/0/12 Connection Server connected 32 a-full a-1000 10/100/1000BaseTX SFP\r\nMS-2673-DC-CS01#exit\r\n'