Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法检查 Tkinter 画布是否有项目或为空?
我尝试了类似的东西
prints self.canvas.winfo_children()
但它总是打印一个空列表、项目或没有项目。
您可以使用self.canvas.find_all()并检查它是否返回一个空元组。
self.canvas.find_all()