fork download
  1. from Tkinter import *
  2.  
  3. canvas = Canvas(width=300, height=300, bg='white')
  4. canvas.pack(expand=YES, fill=BOTH)
  5.  
  6. canvas.create_rectangle(200, 200, 300, 300, width=5, fill='red')
  7.  
  8.  
  9. widget = Label(canvas, text='AAA', fg='white', bg='black')
  10. widget.pack()
  11. canvas.create_window(100, 100, window=widget)
  12. mainloop()
Runtime error #stdin #stdout #stderr 0.02s 27712KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
ImportError: No module named 'Tkinter'