Head office, Rana Pratap Bagh, Delhi011 2721 1512+91 97116 99511

Science project idea

Tkinter attendance register app with a monthly summary and CSV export

Many coaching centres and small workshops mark attendance in a notebook and later struggle to total it. A desktop app in Python with Tkinter can store students, mark present or absent each day, and give a percentage report, which teaches file handling and a graphical user interface.

What it shows

Many coaching centres and small workshops mark attendance in a notebook and later struggle to total it. A desktop app in Python with Tkinter can store students, mark present or absent each day, and give a percentage report, which teaches file handling and a graphical user interface.

The science

Tkinter provides windows, labels, buttons, checkbuttons and tables (Treeview). The program keeps attendance as rows of date, student and status in a CSV file. When a day is saved, rows are appended. A summary reads the file, counts present days per student for the month with a dictionary, and divides by the total days to give the percentage.

Materials

Cost: free. Many items come from home or from waste; spare parts such as LEDs, motors and wire are in the store.

  • A laptop or desktop with Python 3 (Tkinter is included)
  • The csv and datetime modules
  • A text editor
  • A list of 25 sample student names
  • Spreadsheet software to open the exported file

Safety

For this project: Use sample names only. Keep a backup copy of the data file.

Never use mains electricity: power models with cells, batteries or a low-voltage adapter. Sharp and hot tools, flames and lab chemicals need an adult or your teacher beside you. Keep magnets, button cells and small parts away from young children, and wash your hands after making.

All the safety rules

Step by step

10 steps. Do them in order, and test each part before you go on to the next. Write what you notice in a notebook as you go.

  1. Plan the screens on paper: a main window with a date field, a list of students with checkboxes and a Save button, and a second window for reports.

  2. Create the students.csv file with sample ids and names and write a function that loads it into a list.

  3. Build the main window with Tkinter and show each student with a checkbutton set to present by default.

  4. Write save_attendance, which appends one row per student with date and P or A to attendance.csv.

  5. Stop a second save for the same date by checking the file first and asking the user to confirm.

  6. Write a monthly summary function that reads the file, groups by student and calculates the percentage.

  7. Show the summary in a Treeview table and colour rows below 75 percent in red.

  8. Add an Export button that saves the summary as a new CSV file that opens in a spreadsheet.

  9. Test with a month of invented data, including holidays and a student added mid-month.

  10. Write the report with screenshots, the file formats, the test table and ideas to extend.

What you should see

The app saves a day in one click, refuses duplicate dates, shows each student’s monthly percentage with low ones highlighted, and exports a file that opens correctly in a spreadsheet.

Viva questions

A teacher or a judge will ask how it works. Try to answer each question before you open it, then compare.

1Why store the data in CSV?

It is a simple text file that any spreadsheet can open and that is easy to back up.

2What is a Treeview?

A Tkinter widget that displays data in rows and columns like a table.

3How do you prevent duplicate entries?

Check whether rows for that date already exist before saving.

4What are the limits of a CSV file?

It is slow for large data and does not stop two users from writing at once; a database is better for those cases.

Free ebook: Viva Questions for Science Projects

Take it further

Move the storage to SQLite and add a login so that only the teacher can mark attendance.

Change one thing, measure what happens, and add a table or chart of your readings: that is what turns a model into your own investigation.

Free ebooks for this project

WhatsApp us