If I stirp it back further to:It runs fine in an interactive session but fails with that error when run in a situation where stdin (which input()) reads is not available.
python tst.py works.
python tst.py &, python tst.py < /dev/null, starting the code in the foreground then switching it to the background, etc fail. I've not tested running it from an IDE.
So... how are you running that code?
Code:
while True : try : x = input() print(x) except KeyboardInterrupt : break
python tst.py works.
python tst.py &, python tst.py < /dev/null, starting the code in the foreground then switching it to the background, etc fail. I've not tested running it from an IDE.
So... how are you running that code?
Statistics: Posted by thagrol — Sun Mar 17, 2024 2:10 pm