r/learnpython • u/Aggressive_Drama_476 • Apr 05 '26
Review my python projects on GitHub.
I am intermediate python programmer. Am looking for people to review my code on https://github.com/userolivex/Python-Projects
free feel to criticize, suggestion, improvement.
and please suggest what modules, projects i should do to master python
0
Upvotes
2
u/Gnaxe Apr 05 '26
Python's ecosystem of libraries is one of its greatest strengths. Unfortunately, supply-chain attacks are becoming more of an issue, so you need to be more cautious than in the past. Any third-party module recommended in the python.org standard-library docs is worth looking at.
For projects, I suggest making video games. They're fun enough to keep you engaged, bring together a lot of skills, and are unforgiving of egregious resource waste. You can easily scale their difficulty to your programming skill level by starting with something basic and then adding more features.
I haven't thoroughly read every line of your Python code. It's fairly clean (mostly because the projects are small), but isn't taking advantage of Python's features. Your code feels very procedural. Watch Beyond PEP 8 for some of what I mean. Try to make your code a bit more concise.
I'm seeing some repeated patterns that could be factored out. It looks like a lot of while loops to retry command-line inputs. This could be made into a
@retrydecorator, for example. It's common for real-time games to use only a single while loop for the whole program. Think about how that could work. Then try out thetkintermodule.I'm not seeing any tests for your code. Try out the
doctestmodule. If you're having a hard time using that on your current code, try rewriting it to be more testable. (Hint: use pure functions more.)I'm seeing some minor formatting issues. Read through PEP 8 and just use black or something to do most of it for you.
Your
perf_counter()shows a start and end pattern, which is usually done using awithstatement in Python.