import tkinter as tk
root = tk.Tk()
root.geometry("400x240")
def getSelectionText():
try:
result = text.selection_get()
print(result)
except:
print('Ничего не выбрано!')
text=tk.Text(root, height=10)
text.pack()
btnRead=tk.Button(root, height=1, width=10, text="Read",
command=getSelectionText)
btnRead.pack()
root.mainloop()