+ 3

What is an EOF error and why do i keep getting it

18th Mar 2017, 4:04 PM
Amber
5 odpowiedzi
+ 16
EOF stands for End Of File. As to why you encountered this error, we can't tell precisely without being given the code to identify where the problem is.
18th Mar 2017, 4:16 PM
Hatsy Rei
Hatsy Rei - avatar
+ 6
EOF is raised when the input() reaches the end of your code without reading any data. It might also be raised by file.readline() if you reach the end of file and yet want to read a line.
18th Mar 2017, 5:27 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
As far I noticed, it happens when you have more than one "input" in your code. It seems that SoloLearn doesn't support or just won't implement it for whatever reason. I hope they fix it, because right now you (and I also...) won't be able to make any interactive thing with Python here, except for one single input possibility. I find myself forced to practice my stuff on my machines locally.
18th Mar 2017, 4:23 PM
TheMrRuttazzo
TheMrRuttazzo - avatar
+ 1
@TheMrRuttazzo: You can use input() multiple times. You just need to split the input into multiple lines in the input box. Example: Code: a = input() b = input() Input: abc 123 a would now = "abc", and b would = "123" If you were to input: abc 123 a would now = "abc 123", and b would throw an EOFError. It isn't a great implementation of input(), but it is possible to use input() multiple times.
18th Mar 2017, 7:37 PM
Martian1oh1
Martian1oh1 - avatar
0
Ok, Python is definitely glitched on SoloLearn. Wherever I type "input()" inside a code, even when it's just inside a function or class and doesn't get called, as soon as I run the program, it immediately wants some input first and runs the whole thing afterwards. And if you call an input function a second time, you'll get the EOF error. On top of that, in the browser version, if you have a string that starts with a whitespace (i.e. if you want some ascii output), it skips that first space completely and shows only the rest instead. So I'm pretty sure it isn't me, especially considering my codes working on just any standard python console on my other machines.
22nd Mar 2017, 12:33 AM
TheMrRuttazzo
TheMrRuttazzo - avatar