fork download
  1. # your code goes herefrom tkinter import *
  2.  
  3. # Definimos una función a ejecutar al clic el botón
  4. def hola():
  5. print("Hola mundo!")
  6.  
  7. root = Tk()
  8.  
  9. # Enlezamos la función a la acción del botón
  10. Button(root, text="Clícame", command=hola).pack()
  11.  
  12. root.mainloop()
Runtime error #stdin #stdout #stderr 0.01s 7180KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 7, in <module>
NameError: name 'Tk' is not defined