Я слишком глупый, объясните мне ПОЧЕМУ не работает???
Данные для ввода:
124125-12521251-125
652612-72374734-136
136136-26236713-136
137235-16372072-136
import tkinter as tk
from collections import defaultdict
from tkinter import *
from tkinter.scrolledtext import ScrolledText
def ex():
global s
#print(st.get(1.0, END).splitlines())
s=st.get(1.0, END).splitlines()
s.sort()
print(s)
def ready():
b = defaultdict(list)
for x in s:
key, val = x.split('-',1)
b[key].append(val)
print(b)
def delete_text():
st.delete(1.0, END)
#Окно
tk=Tk()
tk.geometry("550x350")
tk.title('1')
# могострочн
my_text = Text(tk,width = 30, height = 15)
my_text.pack()
my_text.place(x=50,y=50)
# but 1
but1 = Button(tk,text="99",width=17,height=2, )
but1.place(x=400,y=50)
# but 2
st = ScrolledText(tk, width=40, height=25); st.grid(row=1, column=1)
st.place(x=50,y=50)
but2 = Button(text="знач",width=17,height=2,command=ex)
but2.place(x=400,y=110)
# but 3
but3 = Button(text="del",width=17,height=2,command=delete_text)
but3.place(x=400,y=170)
# but 4
but4 = Button(text="4",width=17,height=2,command=ready)
but4.place(x=400,y=240)
tk.mainloop()
P.S. Спасибо)