Tkinter radiobutton IntVar Attribute error

后端 未结 1 1638
时光取名叫无心
时光取名叫无心 2020-12-07 04:55

I know that when you use radiobuttons you need to set the variable to IntVar() if you want to use a number. Unfortunately the code I am running below comes with the followi

相关标签:
1条回答
  • 2020-12-07 06:00

    You need to create the root widget before creating the IntVar object.

    Adjust the code to create a root widget first:

    root = Tk()  # <---
    v = IntVar()
    
    0 讨论(0)
提交回复
热议问题