Код: Выделить всё
Traceback (most recent call last):
File
"c:\@python\@w4itdev\lib\site-packages\speedtest.py",
line 156, in
import_builtin___
ModuleNotFoundError: No module named '__builtin__
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"C:\@python\@w4itdev\Lib\site-packages\cx_Freeze\initscript s_startup__.py", line 141, in run module_init.run(name + "__main__")
File
"C:\@python\@w4itdev\Lib\site-packages\cx_Freeze\initscript
s\console.py", line 25, in run
exec(code, main_globals) File "st.py", line 2, in
File "c:\@python\@w4itdev\lib\site-packages\speedtest.py", line 179, in
_py3_utf8_stdout= _Py3Utf8Output(sys.stdout)
File "c:\@python\@w4itdev\lib\site-packages\speedtest.py", line 166, in __init__
buf FilelO(f.fileno), 'w')
AttributeError: 'NoneType' object has no attribute 'fileno'
Код: Выделить всё
from tkinter import *
from speedtest import Speedtest
def update_text():
speed_test = Speedtest()
download = speed_test.download()
upload = speed_test.upload()
download_speed = round(download / (10**6), 2)
upload_speed = round(upload / (10**6), 2)
down_label.config(text= "Download Speed - " + str(download_speed) + "Mbps")
up_label.config(text= "Upload Speed - " + str(upload_speed) + "Mbps")
root = Tk()
root.title("Internet Speed Tracker")
root.geometry('300x300')
button = Button(root, text="Get Speed", width=30, command=update_text)
button.pack()
down_label = Label(root, text="")
down_label.pack()
up_label = Label(root, text="")
up_label.pack()
root.mainloop()
Кстати.. .chatgpt ходит по кругу, пытаясь решить эту проблему.
Подробнее здесь: https://stackoverflow.com/questions/788 ... when-using