0
Problem with EOF for tokenizer
I’m trying to create a tokenizer(or lexer) that tokenizes what you input, basically taking what’s in parenthesis or quotations, and running code using that information, but i’m getting a syntax error. Try running the code and inputting something random, an error will appear. Why is this showing up and more importantly, how do I fix it? If someone could help me I would be very grateful. https://code.sololearn.com/ciqc75bOKAWG/?ref=app
5 odpowiedzi
+ 2
blazer! the line 95 (the one above above the error line) is missing a closing parenthesis.
+ 4
Hi, blazer!
When you use input() in a
while loop like this:
while True:
input()
…
n SoloLearns app, you get EOFError. So you have to catch the error and handle it.
Start looking at this file, about how you can handle multiple inputs in SoloLearns Playground:
https://code.sololearn.com/cbPe32KfwQhF/?ref=app
+ 2
On Sololearn this code is guaranteed to end with an EOF (End Of File) error because it takes input inside an infinite loop. Console programs on Sololearn take all input before running the program and cannot run interactively.
You can fix it by providing a command that the user can add to exit the loop.
+ 1
thank you!!
0
Thank you guys, that fixed it, but when I tried to add a few things it still isnt working, it is always in the same line, no matter what I write on the line.