How to delete all children elements?

前端 未结 1 746
盖世英雄少女心
盖世英雄少女心 2020-12-01 23:56

I am writing a GUI-based program using Python\'s tkinter library. I am facing a problem: I need to delete all children elements (without deleti

相关标签:
1条回答
  • 2020-12-02 00:23

    You can use winfo_children to get a list of all children of a particular widget, which you can then iterate over:

    for child in infoFrame.winfo_children():
        child.destroy()
    
    0 讨论(0)
提交回复
热议问题