I'm making a console application, and i want to create a feature where you can create your own command if you feel like it's needed. Here is my code:
else: print('Unknown command entered. Would you like to give this command a meaning') temporary_console_input = console console = input('Y or N? ') creating_new_command_temp_waiting = True while creating_new_command_temp_waiting == True: if console == 'y': # Placeholder else if console == 'Y': # Placeholders else if console == 'n': # Placeholders else if console == 'N': # Placeholders else if console == 'sys.exit(0)': print('Shutting down') sys.exit(0) else: print('Unknown Option Entered. Please try again.') creating_new_command_temp = console logger.info('Creating command: "' + console + '"')I would like to know if there is a way to create a variable with the name of console's current state. (e.g. if console is set to 4, create a variable named 4)
Self-taught HTML, CSS, Python, and Java programmer