Teaching database-driven programming
Python
1
Python Programing
• First Install Anaconda
• Download Anaconda
– Go to the official website:
• [Link]
– Click "Download".
– Choose your Operating System (Windows, macOS, or Linux).
– Download the Python 3.x version (most likely 3.10 or newer)
2
Quiz game Script by Using python
Dear teachers, assume yourself
as students and you are given
a Python script for a quiz game.
A. Use input() to ask questions.
B. Store answers in variables.
C. Use if/else statements to check
correctness.
D. Track scores with a counter
variable.
E. Add loops to let users retry
incorrect answers
3
Simple python Quiz
4
5
6
Activity
1. Use Python to connect to SQLite and
5.5
manage a grade table.
Project-Based Activity:
Student Grade Tracker
2. Implement CRUD operations (e.g.,
add a grade, calculate averages).
3. Build a simple HTML/CSS interface to
display grades.
4. Integrate both front and backends by
using the basic python
framework(flask).
7
The project contains
• Basically the code contains HTML/CSS for Front end and
Python with Flask frame work
• In detail the source code contains
1. [Link] which is python code for backend
2. [Link] and [Link] for front
end(interface )
3. Sqlit3 database (Auto generative )
4. Flask frame work to connect interface and
Sqlit3
NB: The code performs CRUD Operations and store the data in SQLIT Database
8
File Structure on disk
• gradeApp (folder)
• [Link] (python code)
– Contains Python code as Backend
with Flask application.
• Templates (folder) contains
[Link] and [Link]
Which is the main user interface for
add/search/delete used as fronted 9
Instructions to Run the code
1. Create Folder named gradeApp
2. Save Python code in [Link] in side gradeApp
3. in side gradeApp folder Create another folder
named templates
4. Inside templates, save: [Link] and [Link]
5. Then write the command pip install flask in
python terminal
6. Then write the command cd gradeApp
7. THEN write the command [Link]
8. Finally Open browser and go to
:[Link]
10
After You Run
User interface With CRUD Operations
11
Your file structure after code Executions
12
THANK YOU !!
13