from tkinter import *
from speedtest import Speedtest
def test():
st = Speedtest()
st.download()
st.upload()
download_speed = round(st.results.download / (10**6), 2)
upload_speed = round(st.results.upload / (10**6), 2)
download_label.config(text="Скорость загрузки:\n" + str(download_speed) + " Mb/s")
upload_label.config(text="Скорость отдачи:\n" + str(upload_speed) + " Mb/s")
root = Tk()
root.geometry("400x400")
root.title('Speed Test')
root.resizable(True, False)
button = Button(root, text='Нажми', font=90, command=test)
button.pack(side=BOTTOM, pady=40)
download_label = Label(root, text="Скорость загрузки:\n=", font=40)
download_label.pack(pady=(40, 0))
upload_label = Label(root, text="Скорость отдачи:\n=", font=40)
upload_label.pack(pady=(10, 0))
root.mainloop()
^^^^^^^^^^^^^^ *
можете исправить плиз? :( код снизу
from tkinter import *
from speedtest import Speedtest
def test():
downloand = Speedtest().downloand()
upload = Speedtest().upload()
dowloand_speed = round(downloand / (10**6), 2)
upload_speed = round(upload / (10**6), 2)
dowloand_label.config(text="скорость загрузки:\n" + str(downloand_speed) + "MbPs")
upload_label.config(text="скорость подачи:\n" + str(upload_speed) + "MbPs")
root = Tk()
root.geometry("400x400")
root.title('Games')
root.resizable(True, False)
button = Button(root, text='Нажми', font=90, command=test)
button.pack(side=BOTTOM, pady=40)
dowloand_label = Label(root, text="скорость загрузки:\n=", font=40)
dowloand_label.pack(pady=(40, 0))
upload_label = Label(root, text="скорость подачи:\n=", font=40)
upload_label.pack(pady=(10, 0))
root.mainloop()