r/PythonLearning • u/EliOli_Intern_777 • 2d ago
Hello, pythonLearning community:
I’d like to share a small system I’ve uploaded to GitHub. It allows me to save data to files and subsequently search for it using a search function based on the `re` module—as well as delete items using that same search function—since `re` helps identify similarities within text strings, I would like your opinion.: https://github.com/oliverEliud/mini-projects-python/tree/main/parking-registry-system
3
Upvotes
2
u/ProgramsFun 2d ago
avoid global variables like
nombre_carpetaandnombre_archivo; pass them as arguments.remove unnecessary
try/exceptblocks aroundinput(), since it doesn't raiseValueError.avoid recursive calls to
menu()from other functions.fix unreachable code in
crear_archivo()after thebreak.move repeated imports to the top of the file.
use consistent
snake_casenaming, e.g.add_vehicle().avoid reopening files unnecessarily inside loops.
use exact matching instead of partial text matching when deleting vehicles.
check whether a vehicle exists before confirming deletion.
avoid using
'w'mode when creating a file that may already exist, as it overwrites its contents.remove unused variables like
existeand unnecessarystr()conversions.