Skip to content
Sign upLog in
Simple Python IDE
Profile icon
AR199

This is a simple Python IDE I made using the exec function.

You are viewing a single comment. View All
Profile icon
Dunce

tip:
instead of always raising a syntax error, no matter what the error actually is, like you're doing here:

try: print(f"{cyan}", end="") for thng in thing: if thng in tokens: print(f"{green}", end="") exec(thing) except: print(colored("Syntax Error.", "red"))

you can get what the actual error is, like so:

try: print(f"{cyan}", end="") for thng in thing: if thng in tokens: print(f"{green}", end="") exec(thing) except Exception as error: print(colored(error, "red"))

this can also be useful for debugging.

Profile icon
AR199

@Dunce
Okay, thank you!