Mar-08-2023, 04:23 PM
(This post was last modified: Mar-08-2023, 04:23 PM by deanhystad.)
You forgot to post the error message. You only posted the stack trace. The error message says what happened. The stack trace says where it happened.
The error is not in label, that is just where the error causes the program to crash. The error will be in the code you selected to run. It tried to make a label but passed a bad argument.
There is no <string> file. This would be the menu option you selected. The program reads the associated file into a str, and passes that to exec()
The error is not in label, that is just where the error causes the program to crash. The error will be in the code you selected to run. It tried to make a label but passed a bad argument.
There is no <string> file. This would be the menu option you selected. The program reads the associated file into a str, and passes that to exec()
exec(open(menu_options[selected]).read()) # filename = menu_options[selected] # <string> = open(filename).read() # exec(<string>)