DuhonTheGuy / RPG-Generator

MIT License
8 stars 4 forks source link

Possible solution to TypeError when inputting options #10

Closed ghost closed 3 years ago

ghost commented 3 years ago

Solves the issue of python raising an exception when calling int() on an object that can't be converted to an int, The while loop is so that the user has to input an option or close the program. The problem with just doing a general try: except: clause is that other errors that you may not want to catch can be included such as someone attempting to control + c out of the program inside of the terminal. That being said it is possible to write this main menu in cleaner code I can attempt an example later if you would like.