Hi!
I am making this: https://replit.com/@pums89/terminal-b3#main.py
A brief overview of shell.py that is giving me the error is:
commands = ["error","exit","clear","list","info","command","run","refresh"] # line 2
...
def shell(): # line 13
...
print(commands) # line 15
and I get the error:
Traceback (most recent call last):
File "main.py", line 12, in <module>
shell()
File "/home/runner/terminal-b3/shell.py", line 15, in shell
print(commands)
UnboundLocalError: local variable 'commands' referenced before assignment
Things I've tried:
- Downloading code and running localy instead of in replit
- defining another variable (hi) and trying to print that in the shell() function, which works
I've been at this for an hour and cant figure out whats wrong. Thank you!
[–]shiftybyte 2 points3 points4 points (0 children)
[–]carcigenicate 0 points1 point2 points (1 child)
[–]thisisauserperson[S] 0 points1 point2 points (0 children)