fork download
  1. from tkinter import*
  2. I=IntVar
  3. B=Checkbutton
  4. class f(Tk):
  5. def __init__(self):
  6. s=self
  7. Tk.__init__(s)
  8. s.c=I()
  9. s.v=I()
  10. s.C=B(self,text="FAST",variable=s.c,onvalue=1,offvalue=0)
  11. s.C.pack()
  12. s.cs=0
  13. Tk.after(s,100,f)
  14. def f(self):
  15. s=self
  16. if s.c != s.cs:
  17. print(s.c)
  18. s.cs=s.c
  19. Tk.after(s,100,f)
  20. f().mainloop()
  21.  
Runtime error #stdin #stdout #stderr 0.08s 12616KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "/usr/lib/python3.2/tkinter/__init__.py", line 40, in <module>
    import _tkinter
ImportError: No module named _tkinter

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
  File "/usr/lib/python3.2/tkinter/__init__.py", line 42, in <module>
    raise ImportError(str(msg) + ', please install the python-tk package')
ImportError: No module named _tkinter, please install the python-tk package