# Import Netmiko Modules from netmiko.brocade import BrocadeFastironSSH from netmiko import ConnectHandler # Define the switch type (See Netmiko Documentation) Brocade_ICX = { 'device_type': 'brocade_fastiron', 'ip': '10.10.10.1', 'username': 'username', 'password': 'password', } # Connect to the device with SSH net_connect = ConnectHandler(**Brocade_ICX) # Open a file file = open('output.txt', 'w') # Send Commands to the switch output = net_connect.send_command('skip-page-display') output = net_connect.send_command('show int brief') # Send output to the screen print(output) # Send output to a file and close it file.write(output) file.close()