Button in Tkinter

Button widget is a standard Tkinter widget For Graphical User Interface(GUI),which is used to perform a specific operation when it is clicked. Button is a widget which is designed for the user to interact with, i.e. if the button is pressed by mouse click some action might be started. Button can also contain text and images like labels. While Labels can display text in various fonts(Times, Helvetica etc ), a button can only display text in a single font. The text of a button can span more than one line. Function or method will be executed, if the button is pressed in some way.

Example : Here is Your First Button Tutorial.


from tkinter import *

root= Tk()
root.title("Button Example")
root.config(background="#FFF8DC")
root.geometry("900x400+350+86")

btn= Button(root, text="Click Me")
btn.pack(pady=20)

root.mainloop()

Write Down Code Your Code Editor. To show Your Output. If Use Pycharm Press Shift+F10 and Show Your Output.


Enjoy.........

If You Want To Learn More Plz Visit www.newpost24.com

If You Find Specific link plz Follow This Page.


Post a Comment

أحدث أقدم