fork download
  1. from tkinter import *
  2. from tkinter.ttk import *
  3.  
  4. def neww():
  5. def test2():
  6. print(var2.get())
  7.  
  8. root2 = Tk()
  9. var2 = IntVar(value=1)
  10. check2 = Checkbutton(root2, text='Test2', variable=var2, command=test2)
  11. check2.pack()
  12.  
  13. def test():
  14. print(var1.get())
  15.  
  16. root = Tk()
  17. var1 = IntVar(value=1)
  18. check1 = Checkbutton(root, text='Test', variable=var1, command=test)
  19. check1.pack()
  20. neww()
  21. root.mainloop()
  22.  
Runtime error #stdin #stdout #stderr 0.02s 76608KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 16, in <module>
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1880, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable