you dont need the exit thing. The user can just type in exit() into the interpriter, and it will work. You could also use a while True loop, and use the break statement in order to exit. You could also do this:
try:
eval(input())
except Exception as e:
print(e)
That will print the exception onto the screen, and is better than: Syntax Error, as sometimes it wont be Syntax Error all the time
I saw a repl from someone else who made a python Interpreter. That project is bad, so I made a better one :)
you dont need the exit thing. The user can just type in exit() into the interpriter, and it will work. You could also use a while True loop, and use the break statement in order to exit. You could also do this:
That will print the exception onto the screen, and is better than:
Syntax Error
, as sometimes it wont beSyntax Error
all the time@TaylorLiang I will change it, thanks for your feedback