Hello! I’m currently learning CS fundamentals through the CS Careerpath and I thought I’d share my first portfolio project! A detailed blog post on the program and how it works can be found here. At the bottom of the post, you’ll find a link to the github repository with all the code for the project. If you get a chance to pop in and look at it, please let me know what you think!
Hey!
Some tips:
- Don’t use
time.sleep
unless absolutely necessary. Withsleep
s, it looks like your program is running slowly. - Validate user input before using it. For example, in the “menu” function, the user can enter “8” or “b” and Python will throw an exception. You can find more information about user interaction in the course https://www.codecademy.com/learn/paths/build-chatbots-with-python.
- Create
Available_recipes.txt
at application startup if it doesn’t exist. Otherwise you can get aFileNotFoundError
. - I don’t think using a GUI like
filedialog
in a console application is a good idea. If you are writing a console application, allow any operations to be performed from the console. - If you want to use commands from the OS, check the OS name first. What if your application runs on Linux, for example. See sys — System-specific parameters and functions — Python 3.10.2 documentation.
- If you are asking a question to the user like
input('continue?')
in thewait
function, process the response. For example, I don’t want to continue, I typen
, but the program doesn’t exit. It’s confusing. - Use a shorter representation for objects in the
__repr__
method. The “This recipe contains information on how to make” part does not contain much information about the object. Especially when debugging an application.
Well done!
1 Like