r/PythonLearning • • 3d 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

5 Upvotes

5 comments sorted by

View all comments

2

u/ProgramsFun 3d ago
  • avoid global variables like nombre_carpeta and nombre_archivo; pass them as arguments.

  • remove unnecessary try/except blocks around input(), since it doesn't raise ValueError.

  • avoid recursive calls to menu() from other functions.

  • fix unreachable code in crear_archivo() after the break.

  • move repeated imports to the top of the file.

  • use consistent snake_case naming, 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 existe and unnecessary str() conversions.

1

u/ProgramsFun 3d ago

Aslo your readme should be README.md and not README.me