import telnetlib
import time
from tkinter import *
def telnet_proc():
ip='192.168.100.1'
connect=telnetlib.Telnet(ip)
connect.write(b'root\r\n')
time.sleep(1)
connect.write(b'admin\r\n')
time.sleep(1)
connect.write(b'su\r\n ')
time.sleep(1)
connect.write(b'reset\r\n ')
time.sleep(1)
print('Done')
#===========Первая кнопна============
root = Tk()
root.title("Прошивки и конфигурации")
root.geometry("600x300")
l = Label(text ="")
but1 = Button(root,text="EPON Mode 1",command=telnet_proc,padx=75)
but1.pack( pady=20)
l.pack(side=BOTTOM)
#===========Третья кнопка============
but2 = Button(root)
but2["text"] = "Прошивка промежуточная"
but2.pack()
input()