Answers for "how to make buttons in python tkinter"

2

how to add button in tkinter

from tkinter import *
window = Tk()

def got_clicked():
  print("I got clicked!")

my_button = Button(text="Click me", command=got_clicked)
my_button.pack()

window.mainloop()
Posted by: Guest on February-01-2021
1

button tkinter

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()
Posted by: Guest on May-30-2020

Code answers related to "how to make buttons in python tkinter"

Python Answers by Framework

Browse Popular Code Answers by Language