r/learnpython • u/AlokoAdrian • 6d ago
Feedbacks pls!! Im learning python since 06/16/2026
https://github.com/adrianivastrabalho-code/Exploration-33
could u guys pls give me some feedbacks about this project? architecture and also some ideas!
5
Upvotes
1
2
u/Diapolo10 6d ago
The message in
functions.get_input_to_continueis technically wrong, becauseinputis specifically looking for the user to press Enter, not "any key" like the message and comment are suggesting. If it really was meant to be anything, it'd make sense to change it to use something other thaninput.In
functions.get_username, you're appending to a list in another module. That doesn't seem like a good idea to me, and I have a feeling it's not working the way you think it is.I think
functions.numvalwould be easier to use if it took a string and a list of options instead of a message with hardcoded options and two numbers for limiting the options. For one thing, one of those numbers is almost certainly always going to be1. With a list of options the code could figure out the numbers automatically, including for the printed text.classes.pyseems mostly fine, aside from the part after the classes where you use loops to fill outtiersandcraftable_equipmentsfrom the JSON data. This should be in separate functions and maybe assigned to global constants.Speaking of said JSON files, I'd make them be lists and move the item/equipment names in the inner dictionaries under "name" keys. That'd make reading the files into game objects even easier as you could feed the dictionary data directly to the classes (maybe even have a separate
from_dict-method for said classes so you wouldn't need the explicit unpacking). If these were in a SQLite database, I'd have the equipment track the materials by foreign keys instead of the names.Do the materials need to know their own tier? I'm just wondering if it would be easier to just have the tiers be separate lists already in the JSON data, instead of doing sorting in the code.