def ssh_main():
 ip = raw_input('Enter IP Address: ')
 username = 'pyclass'
 password = getpass()
 test_device = NetworkDevice(ip, username, password)
 (remote_conn_pre, remote_conn, _) = ssh.establish_connection(ip, username, password)
 ssh.disable_paging(remote_conn)
 remote_conn.send('\n')
 remote_conn.send('show version\n')
 test_device.show_version = ssh.read_ssh_data(remote_conn)
 remote_conn_pre.close()
 process_show_version(test_device)
 net_device_verification(test_device)
 with open('ssh_file.pkl', 'wb') as f:
  pickle.dump(test_device, f)

def ssh_main ( ) : ip = raw_input ( 'Enter IP Address: ' ) username = 'pyclass' password = getpass ( ) test_device = NetworkDevice ( ip , username , password ) ( remote_conn_pre , remote_conn , _ ) = ssh . establish_connection ( ip , username , password ) ssh . disable_paging ( remote_conn ) remote_conn . send ( '\n' ) remote_conn . send ( 'show version\n' ) test_device . show_version = ssh . read_ssh_data ( remote_conn ) remote_conn_pre . close ( ) process_show_version ( test_device ) net_device_verification ( test_device ) with open ( 'ssh_file.pkl' , 'wb' ) as f : pickle . dump ( test_device , f )
process show version using ssh .