fork(1) download
  1. from tkinter import *
  2. from tkinter.filedialog import *
  3. def a_foo():
  4. screen.insert(END,'Aa')
  5. def b_foo():
  6. screen.insert(END,'Bb')
  7. def c_foo():
  8. screen.insert(END,'Cc')
  9.  
  10. w = Tk()
  11. screen = Entry()
  12. b1 = Button(text='A',command=a_foo)
  13. b2 = Button(text='B',command=b_foo)
  14. b3 = Button(text='C',command=c_foo)
  15. screen.pack()
  16. b1.pack()
  17. b2.pack()
  18. b3.pack()
  19. w.mainloop()
Runtime error #stdin #stdout #stderr 0.05s 26344KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 10, in <module>
  File "/usr/lib/python3.4/tkinter/__init__.py", line 1854, in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable