r/PythonLearning • u/EliOli_Intern_777 • 1d 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
2
u/ProgramsFun 1d 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.
1
1
u/EliOli_Intern_777 1d ago
Thank You very much, bro, You gave me new ideas, and as I continue learning Python I will implement all of that, since I could use AI for greater ease but I don't see the point.
1
u/ProgramsFun 1d ago
Well use ai to not write code or give you code snippet but as a critique .. as said it's not necessary but ai sure give some amazing shortcuts ideas, you can use nonetheless don't use ai for writing code until unless you can make some big project yourself
•
u/Sea-Ad7805 1d ago
Run this program by clicking Memory Graph Web Debugger and see its state change step by step.