0% found this document useful (0 votes)
3 views

Setting Up A Python Virtual Environment and Creating A Tkinter Form With MySQL Database

Uploaded by

S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Setting Up A Python Virtual Environment and Creating A Tkinter Form With MySQL Database

Uploaded by

S
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab Sheet 05 01.

Programming Batch 23

Setting Up a Python Virtual Environment and Creating a Tkinter Form


with MySQL Database
Tasks:
1. Create a Python virtual environment.
2. Install tkinter and mysql-connector-python.
3. Build a form to enter customer details.
4. Create a login system with different privileges (customer and admin).

1. Setting Up the Virtual Environment

i) Open Command Prompt or Terminal.


ii)Navigate to Your Project Directory.
iii)
Create a Virtual Environment. (python -m venv venv)
iv)Activate the Virtual Environment. (venv\Scripts\activate)
v) Install Required Libraries (tkinter and mysql-connector-python or pyodbc)
(a) pip install mysql-connector-python / pip install pyodbc
(b) pip install tk

2. Set Up MySQL Database (Using XAMPP)


a. Open XAMPP and Start MySQL.
b. Create a Database and a Table in phpMyAdmin.
i. Go to http://localhost/phpmyadmin.
ii. Create a database named customer_db.
iii. Inside customer_db, create two tables

Mrs. ALF. Sajeetha


Lecturer – IT BCAS
Lab Sheet 05 01. Programming Batch 23

If you have machine installed and configured MS SQL Server


3. Set Up MS SQL Server Database
1. Open Microsoft SQL Server Management Studio (SSMS) and connect to your server.
2. Create a New Database
3. Right-click on Databases > New Database.
4. Name the database Customer_db.
5. Execute the same SQL Query below

4. Create a Customer Entry Form with Tkinter


a. Create a Customer Entry Form using Tkinter library
b. Run the script to open the Tkinter form, fill in details, and submit to store the data in
your MySQL database.

5. Create a Login System for Customer and Admin Privileges

i) Create a Login System with two Different Privileges


ii) Run the script to open the login window. Enter the username and password to check
privileges.

Mrs. ALF. Sajeetha


Lecturer – IT BCAS

You might also like