import tkinter as tk root = tk.Tk() text = tk.Text(root) text.insert('1.0', 'line 1\nline 2\n') text.insert('insert', 'line 3\n', 'sel') text.pack() text.selection_own() # Needed, else next two lines give None, TclError. print('owner:', text.selection_own_get()) # .!text print('text: ', text.selection_get()) # 'line 3' text.selection_clear() print('text: ', text.selection_get()) # TclError, no selection