- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Python List Comprehension tutorial for Device interface status| Part 31|TEXTFSM output with NETMIKO
𝗙𝗼𝗿 𝗖𝗼𝗺𝗽𝗹𝗲𝘁𝗲 𝗣𝘆𝘁𝗵𝗼𝗻 𝗙𝗼𝗿 𝗡𝗲𝘁𝘄𝗼𝗿𝗸 𝗘𝗻𝗴𝗶𝗻𝗲𝗲𝗿𝘀 𝗖𝗼𝘂𝗿𝘀𝗲:
𝗘𝗻𝗿𝗼𝗹𝗹 𝗳𝗼𝗿 𝗯𝗲𝗹𝗼𝘄 𝗨𝗱𝗲𝗺𝘆 𝗖𝗹𝗮𝘀𝘀: 𝟐𝟎𝟐𝟐 𝐕𝐞𝐫𝐬𝐢𝐨𝐧
𝑫𝒊𝒔𝒄𝒐𝒖𝒏𝒕𝒆𝒅 𝑹𝒆𝒇𝒆𝒓𝒓𝒂𝒍 𝑳𝒊𝒏𝒌:
https://www.udemy.com/course/python-for-network-engineers/?referralCode=35A75AAE1ACA94A15829 List comprehension tutorial, for creating the list esily from list of dictionaries in Python. Compare for loop and if logic with list comprehension.
Explained list comprehension logic with example.
How to list Cisco device interface status using Python, TEXTFSM, NETMIKO and list comprehension logic
from netmiko import ConnectHandler
from operator import itemgetter
RTR_10 = {
'ip': '10.10.10.10',
'username': 'admin',
'password': 'admin',
'device_type': 'cisco_ios',
}
print ('Checking interface status..')
net_connect = ConnectHandler(**RTR_10)
output = net_connect.send_command('show ip int brie', use_textfsm=True)
devlist = []
for i in output:
if i['status'] == 'up':
devlist.append(i['intf'])
print(devlist)
print([i for i in output if i['status'] == 'up'])
print ([i['intf'] for i in output if i['status'] == 'up'])
print('\n \n')
print ('\nList of interfaces which are UP \n')
statusup =[i['intf'] for i in output if i['status'] == 'up']
for ifaceup in statusup:
print (ifaceup)
print ('\nList of interfaces which are DOWN \n')
statusother =[i for i in output if i['status'] != 'up']
for ifaceother in statusother:
print (ifaceother['intf'] + ' ' + ifacesother['status'] )
Видео Python List Comprehension tutorial for Device interface status| Part 31|TEXTFSM output with NETMIKO канала NetworkEvolution
𝗘𝗻𝗿𝗼𝗹𝗹 𝗳𝗼𝗿 𝗯𝗲𝗹𝗼𝘄 𝗨𝗱𝗲𝗺𝘆 𝗖𝗹𝗮𝘀𝘀: 𝟐𝟎𝟐𝟐 𝐕𝐞𝐫𝐬𝐢𝐨𝐧
𝑫𝒊𝒔𝒄𝒐𝒖𝒏𝒕𝒆𝒅 𝑹𝒆𝒇𝒆𝒓𝒓𝒂𝒍 𝑳𝒊𝒏𝒌:
https://www.udemy.com/course/python-for-network-engineers/?referralCode=35A75AAE1ACA94A15829 List comprehension tutorial, for creating the list esily from list of dictionaries in Python. Compare for loop and if logic with list comprehension.
Explained list comprehension logic with example.
How to list Cisco device interface status using Python, TEXTFSM, NETMIKO and list comprehension logic
from netmiko import ConnectHandler
from operator import itemgetter
RTR_10 = {
'ip': '10.10.10.10',
'username': 'admin',
'password': 'admin',
'device_type': 'cisco_ios',
}
print ('Checking interface status..')
net_connect = ConnectHandler(**RTR_10)
output = net_connect.send_command('show ip int brie', use_textfsm=True)
devlist = []
for i in output:
if i['status'] == 'up':
devlist.append(i['intf'])
print(devlist)
print([i for i in output if i['status'] == 'up'])
print ([i['intf'] for i in output if i['status'] == 'up'])
print('\n \n')
print ('\nList of interfaces which are UP \n')
statusup =[i['intf'] for i in output if i['status'] == 'up']
for ifaceup in statusup:
print (ifaceup)
print ('\nList of interfaces which are DOWN \n')
statusother =[i for i in output if i['status'] != 'up']
for ifaceother in statusother:
print (ifaceother['intf'] + ' ' + ifacesother['status'] )
Видео Python List Comprehension tutorial for Device interface status| Part 31|TEXTFSM output with NETMIKO канала NetworkEvolution
list comprehension python if list comprehension if else list comprehension python 3 list comprehension python dictionary output textfsm list comprehension syntax list comprehension append list comprehension assignment python 3 list interface status netmiko interface monitor netmiko cisco interface monitor python list interface using for loop and if python 3 list comprehension tutorial understand list comprehension learn listcomprehension python
Комментарии отсутствуют
Информация о видео
2 мая 2019 г. 8:41:59
00:14:16
Другие видео канала




















