편집 기록

편집 기록
  • 프로필 nowp님의 편집
    날짜2021.12.02

    python tkinter 라디오 버튼 만들기 저장 후 실행 오류


    import tkinter as tk
    
    def func1():
        label.config(text = 'Button 1')
    
    def func2():
        label.config(text = 'Button 2')
    
    sel = tk.IntVar()
    sel.set(1)
    
    label = tk.Label(root, text = 'Select Button')
    label.pack()
    
    rb1 = tk.Radiobutton(root, text = 'Button 1', variable = sel, value = 1, command = func1)
    rb1.pack()
    
    rb2 = tk.Radiobutton(root, text = 'Button 2', variable = sel, value = 2, command = func2)
    rb2.pack()
    
    root.mainloop()
    

    틀리게 적은건 없는거 같은데 저장 후 실행할려고 하니까 실행이 안되네요 왜 그런건가요 ?

  • 프로필 알 수 없는 사용자님의 편집
    날짜2019.11.14

    python tkinter 라디오 버튼 만들기 저장 후 실행 오류


    import tkinter as tk

    def func1(): label.config(text = 'Button 1')

    def func2(): label.config(text = 'Button 2')

    sel = tk.IntVar()

    sel.set(1)

    label = tk.Label(root, text = 'Select Button')

    label.pack()

    rb1 = tk.Radiobutton(root, text = 'Button 1', variable = sel, value = 1, command = func1)

    rb1.pack()

    rb2 = tk.Radiobutton(root, text = 'Button 2', variable = sel, value = 2, command = func2)

    rb2.pack()

    root.mainloop()

    틀리게 적은건 없는거 같은데 저장 후 실행할려고 하니까 실행이 안되네요 왜 그런건가요 ?