1 - Scrivi il codice nel tag code
2 - fare from nome_modulo import * te lo sconsiglio
import tkinter as tk
from tkinter import ttk
def cambia(evento):
print(treeview.identify_row(evento.y))
window = tk.Tk()
window.geometry("800x800")
treeview = ttk.Treeview(window)
treeview.config(height = 10)
treeview.heading('#0',text = 'Prova')
treeview.insert('','0','item1',text = 'Primo Item')
treeview.insert('','1','item2',text = 'Secondo Item' )
treeview.insert('','end','item3',text = 'Terzo Item', )
treeview.insert('item1','end','item4',text = 'alfa')
treeview.bind("<Double-1>", cambia)
treeview.pack()