Answers for "how to make a button in python in"

0

add button python

from tkinter import *


master = Tk()

#program you want the button to execute
def closewindow():
    exit()

#set up button
button = Button(master, text="close window", command=closewindow)

button.pack()

mainloop()
Posted by: Guest on July-06-2020
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 a button in python in"

Python Answers by Framework

Browse Popular Code Answers by Language