Exception in Tkinter callback
Traceback (most recent call last):
File "tkinter\__init__.py", line 1883, in __call__
File "links.py", line 26, in cc
File "pyshorteners\__init__.py", line 32, in __init__
File "importlib\__init__.py", line 127, in import_module
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'pyshorteners.shorteners'
from tkinter import*
import pyshorteners
import pyperclip
root = Tk()
root.title("LinkS")
root.geometry("400x320")
root["bg"] = "#222831"
#root.iconbitmap( 'D:/PY сокращения ссылок/link.ico' )
Label(root, bg = "#222831", text="Сокращение cсылок", font="Consolas 20 bold", fg="#EEEEEE").pack(pady=10)
Label(root, bg = "#222831", text="Ввыдите ссылку:", font="Consolas 15 bold", fg="#EEEEEE").pack()
link = Entry(root, fg="#EEEEEE", width=40, bg="#393E46")
link.pack(pady=5)
Label(root, bg = "#222831", text="Сокращенная ссылка", font="Consolas 15 bold", fg="#EEEEEE").pack()
result = Entry(root, fg="#EEEEEE", width=40, bg="#393E46")
result.pack(pady=10)
def cc():
a = link.get()
cok = pyshorteners.Shortener().tinyurl.short(a)
res = result.insert(0, cok)
def copytoclipboard():
url = result.get()
pyperclip.copy(url)
def clear():
link.delete(first=0, last=10000)
result.delete(first=0, last=10000)
Button(root, height='1', width='18', bg = "#41b6e6", text="Сократить ссылку", activebackground="#004d61", command=cc).pack(pady=5)
Button(root, height='1', width='18', bg = "#41b6e6", text="Копировать", activebackground="#004d61", command=copytoclipboard).pack(pady=5)
Button(root, height='1', width='18', bg = "#41b6e6", text="Очистить", activebackground="#004d61", command=clear).pack(pady=5)
root.mainloop()