def listbox_capacity(listbox): font = tkFont.Font(listbox, listbox['font']) return listbox.winfo_height() / font.metrics()['ascent']