0% found this document useful (0 votes)
2 views1 page

Python Lab Assignment 8

This document outlines a Python lab assignment focused on Tkinter, consisting of five programming tasks. The tasks include creating a basic window, handling button clicks, building a simple calculator, developing a login form with validation, and creating a temperature conversion application. Each task aims to teach different aspects of Tkinter, such as window properties, event handling, input validation, and user interface design.

Uploaded by

Vidit Allen
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Python Lab Assignment 8

This document outlines a Python lab assignment focused on Tkinter, consisting of five programming tasks. The tasks include creating a basic window, handling button clicks, building a simple calculator, developing a login form with validation, and creating a temperature conversion application. Each task aims to teach different aspects of Tkinter, such as window properties, event handling, input validation, and user interface design.

Uploaded by

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

PYTHON LAB ASSIGNMENT 8

Tkinter

[Link]. Program
1 Write a Python program to create a basic Tkinter window with the following properties:
 The window title should be "Welcome Window".
 The window should have a fixed size of 500x400 pixels.
 Add a label that says "Hello, Tkinter!" in the center of the window.
Objective: Understand how to create a basic Tkinter window, set window properties, and
add a label widget.
2 Create a Tkinter window with a button labeled "Press Me". When the button is clicked, it
should display a pop-up message box with the text "Button was clicked!".
Objective: Learn how to create buttons and handle events (button clicks) with the
command option and message boxes.
3 Build a simple calculator using Tkinter. The calculator should have buttons for numbers 0-
9, and basic arithmetic operators (+, -, *, /). It should display the result when the user
clicks the "=" button.
Objective: Combine multiple widgets (buttons, labels, and entry boxes) to create a simple
application, and learn about handling input and calculations in Tkinter.
4 Create a login form with two input fields for username and password. Add a "Login"
button that validates the inputs:
 If the username is "admin" and the password is "password123", display "Login
successful" in a label below the button.
 If the credentials are incorrect, display "Invalid username or password".
Objective: Learn about entry widgets, buttons, and basic form validation using Python
logic within a Tkinter application.
5 Create a Tkinter application to convert temperatures between Celsius and Fahrenheit. It
should have:
 Two entry fields: one for Celsius and one for Fahrenheit.
 Buttons to convert from Celsius to Fahrenheit and vice versa.
 Display the converted temperature in the appropriate entry field.
Objective: Practice handling user input and output, as well as using Tkinter's entry boxes
and buttons to build a useful tool.

You might also like