from netmiko import ConnectHandler
cisco_switch = {
'device_type': 'cisco_ios',
'host': '192.168.1.2',
'username': 'admin',
'password': 'password',
'secret': 'password',
'port': 22,
}
ssh = ConnectHandler(**cisco_switch)
ssh.enable()
result = ssh.send_command('sh ver', expect_string = '[#\?$]')
print(result)