0% found this document useful (0 votes)
11 views2 pages

Python Exp5

Uploaded by

BADASS GAMING YT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Python Exp5

Uploaded by

BADASS GAMING YT
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Experiment : 05

Title : Creating GUI with python containing widgets such as labels,


textbox, radio, checkboxes and custom dialog boxes.

Program:
import tkinter as tk
from tkinter import messagebox

Aim : Create a new window


root = [Link]()

Aim : Set the title of the window


[Link]("My GUI")

Aim : Create a label widget


label = [Link](root, text="Welcome to my GUI!")
[Link]()

Aim : Create a textbox widget


textbox = [Link](root)
[Link]()

Aim : Create a radio button widget


radio = [Link](root, text="Option 1",
value=1) [Link]()
radio2 = [Link](root, text="Option 2",
value=2) [Link]()

Aim : Create a checkbox widget


checkbox = [Link](root, text="Check me!")
[Link]()

Aim : Create a custom dialog box


def showDialog():
[Link]("Message", "Hello World!")
button = [Link](root, text="Click me",
command=showDialog)
[Link]()

Aim : Start the main loop of the window


[Link]()

Output:

Conclusion: We have written basic program to create a basic GUI

You might also like