Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5354

Python • Re: EOFError from input( )

$
0
0
You are right. The even more reduced version of the code works as expected. So it is a problem with the port.
I do not think that is the intended, or the correct, conclusion. Removing the serial port facilitates testing.

Precisely. The reported exception was on x = input(). If it was on the serial port it would have been reported as such. Plus I don't have anything connected to my Pi's serial port to test with.
It should not affect whether there is an end of file condition on an unrelated file descriptor.

You should only get EOF on input() if you press Ctrl+D, or if standard input is not the terminal. Are you sure there is "nuttin" between your script and the terminal?

Your original post mentions "polling user input from a process", which suggests that standard input might be a pipe or suttin.

@OP:

Perhaps if you share exactly how you are running the code?

Statistics: Posted by thagrol — Sun Mar 17, 2024 3:56 pm



Viewing all articles
Browse latest Browse all 5354

Trending Articles