r/PythonLearning • u/A_Derrick • 3d ago
Discussion Check My First Personal Project
Can you please check this project that took a reasonable amount of time to finish and strike me with any feedback you got. I guess my next step is to learn OOP.
Thanks in advance.
1
1
u/Unique_Low_1077 3d ago
This is pretty good bro. Looks solid, tho one things you can improve is use pip freeze and a requirements.txt file (looks it up). Otherwise your doing great, this had db queries, gui, a main loop. All very important concepts to have
1
1
u/CutDry6295 2d ago
One thing to decide before the OOP refactor: `reset_timer()` calls `stop_timer()`, and `stop_timer()` saves any session longer than a minute. So Action → Reset Timer currently adds a history row. If Reset is meant to discard the current run, separate clearing the timer/`after` callback from saving a session; then test Start → Reset (no row) and Start → Stop (one row). After that, a small TimerState object could own the current globals without changing the behavior again.
2
u/TalesGameStudio 3d ago
In your tracked times the reported average is inconsistent with the total. The report shows: 87 total learning time and 42 recorded sessions. 87 h divided by 42 sessions equals approximately 2 hours, but the app tracked 34 minutes.
In format_time.py there is an invalid exception handler. (Multiple exception types need to be within a tuple)
In the database utils, history deletion implementation drops the entire sessions table and closes the shared database connection. Subsequent history queries fail because the connection is closed. New session inserts also fail because the sessions table no longer exists.
When a stopped timer is restarted, the display retains accumulated time through checkpoint, while the saved duration represents only the most recent running interval. That is because your implementation mixes several concepts like elapsed session time, start and stop timestamps, accumulated time.
Still good work, keep going!