user21495
0
Q:

python button tkinter

from tkinter import *
def example():
	print("Example")
root = Tk()
clickMe = Button(root, text="Click Me", command=example)
#Would Print "Example" In The CL
6
import Tkinter
import tkMessageBox

top = Tkinter.Tk()

def helloCallBack():
   tkMessageBox.showinfo( "Hello Python", "Hello World")

B = Tkinter.Button(top, text ="Hello", command = helloCallBack)

B.pack()
top.mainloop()
-1
from tkinter import *

wow = Tk()

def ree(hi):
  print(hi)
  
w = Button ( master=wow, command=ree('hi'), text="hi" )

Output:
  Tkinter:
    ______
   [  hi  ] <--- Button
    ------
  
  Shell:
    hi <--- on button pressed
-1

New to Communities?

Join the community