Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. Try the new cross-platform PowerShell https://aka.ms/pscore6 PS C:\Users\roger> cat winfo_id_button.py import tkinter button = tkinter.Button() print(button) i = button.winfo_id() print(i) j = button.tk.call("winfo", "id", button) print(j) p = button.tk.call("winfo", "pathname", j) print(p) q = button.winfo_pathname(j) print(q) PS C:\Users\roger> py -3.12-64 -m winfo_id_button .!button 1181466 0x12071a .!button .!button PS C:\Users\roger> py -3.12-32 -m winfo_id_button .!button 1050300 0x1006bc .!button .!button PS C:\Users\roger>