Skip to content

Conversation

@Deepak-Kumbhar2006
Copy link
Contributor

Working on #50
Session.py will run from main.py
yet need to work on session_analysis.py, just making 1 step forward in #50.
In future many functions are going to be included in analysis file.
for now its just a blank tkinter GUI for other candidate to work on that.

@Deepak-Kumbhar2006 Deepak-Kumbhar2006 changed the title linked main.py with Session_dashboard.py #50 - linked main.py with Session_dashboard.py Aug 13, 2025
Copy link
Owner

@Gagandeep-2003 Gagandeep-2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Entry Point Guard

Right now, the Tk window is created on import. Please wrap the launch in a main() function and add an import guard:

def main():
root = tk.Tk()
root.geometry(WINDOW_SIZE)
root.title(APP_TITLE)

notebook = ttk.Notebook(root)
live_track = ttk.Frame(notebook)
session_his = ttk.Frame(notebook)

notebook.add(live_track, text="Live Tracking")
notebook.add(session_his, text="Session History")
notebook.pack(expand=True, fill="both")

root.mainloop()

if name == "main":
main()

  1. Avoid Wildcard Imports

Instead of:

from tkinter.ttk import *

Use explicit imports:

import tkinter as tk
from tkinter import ttk

  1. Structure for Future Work

Since more functionality will be added in #50, consider using a class or at least helper methods for each tab. Example:

def build_live_tracking_tab(parent):
frame = ttk.Frame(parent, padding=10)
ttk.Label(frame, text="Live Tracking — TODO").pack(anchor="w")
return frame

  1. Widget Packing

Use expand=True, fill="both" when packing the notebook so it resizes properly:

notebook.pack(expand=True, fill="both")

  1. Code Style / Maintainability

Add constants instead of hardcoding values:

WINDOW_SIZE = "600x400"
APP_TITLE = "Session Analysis"

Also add small docstrings or # TODO comments inside tabs so contributors know where to extend.

✅ With these changes, the app will be safer to import, resize correctly, and easier for contributors to extend.

Deepak-Kumbhar2006 added a commit to Deepak-Kumbhar2006/driver-drowsiness-detection-system that referenced this pull request Aug 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants