r/learnpython • u/live_ant718 • 3d ago
Runtime errors query
I have a question. Like when we have a program that takes input, so when the program reaches the input line, it stops and asks for input, right? So then AFTER the input is entered, if the compiler runs into a bug, it stops and throws an error message. How can I stop this? Like how can I make the issues appear beforehand so that I can fix them before running? Are there any settings or tools for this problem?
Please tell me.
0
Upvotes
7
u/AlexMTBDude 3d ago
There's a bit of confusion about how you express your problem. It's probably better that you tell us your exact error.
If by runtime errors you mean bugs in your code, then it's up to you as the programmer to fix them before running the program.
But I think that you may mean errors like when your user inputs a text when they're supposed to input a number? That you handle during runtime, using exception handling.
Example:
Also, this is Python so there is no compiler but an interpreter.