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

Python GUI Login System Tutorial

This presentation teaches how to build a GUI-based login system in Python that verifies user credentials against a stored file. It covers essential File I/O operations, including writing, appending, and reading files, as well as the logic for checking login credentials. The overall goal is to integrate GUI skills with file handling to create a functional application, serving as a capstone for the Python programming section.

Uploaded by

myatkyalsin10
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)
4 views2 pages

Python GUI Login System Tutorial

This presentation teaches how to build a GUI-based login system in Python that verifies user credentials against a stored file. It covers essential File I/O operations, including writing, appending, and reading files, as well as the logic for checking login credentials. The overall goal is to integrate GUI skills with file handling to create a functional application, serving as a capstone for the Python programming section.

Uploaded by

myatkyalsin10
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

### Summary

This presentation focuses on applying Python skills to a real-world


task: building a **GUI-based login system** that checks user
credentials against a file. It introduces **File Input/Output (I/O)**
operations, which are essential for reading and storing data
persistently.

#### Key Topics Covered:

1. **File I/O (Input/Output) in Python:**

* Demonstrates how to work with files using the `open()`


function.

* Explains the difference between key file modes:

* **Write Mode (`"w"`)**: Overwrites the entire file. The


example shows writing a list of lines to a file using `.writelines(L)`.

* **Append Mode (`"a"`)**: Adds new content to the end of the


existing file without deleting it. The example shows appending a
single line with `.write()`.

* **Read Mode (`"r"`)**: Opens a file for reading its contents.


The example shows reading all lines into a list with `.readlines()`.

2. **Reading Data for Login Verification:**

* Provides a code snippet that outlines the logic for a login


check:

* It opens a file (presumably containing usernames and


passwords).

* Reads all lines.

* Splits each line (e.g., using `[Link](',')`) to separate the


username and password values.

* This is the core logic for verifying if a user's input matches


stored credentials.

3. **Integrated Application Project:**

* The main goal is to combine GUI skills (from Lecture 4/5) with
file handling skills to build a **Login Check Application**.

* A mockup of the login dialog is shown, containing fields for


**Username**, **Password**, and buttons for **Login** and
**Close**.

#### Overall Purpose:


The goal of this lecture is to demonstrate how different
programming concepts can be combined to create a functional
application. It moves from isolated examples (GUIs, data structures,
file handling) to a cohesive project. Students are expected to:

* Use **PyQt5** to build the login window.

* Use **File I/O** to read a stored list of usernames and passwords.

* Use **Conditional Logic** to check if the entered credentials


match any in the file.

This serves as a capstone for the Python application programming


section, concluding with a teaser for the next topic: **Software
Engineering**.

You might also like