from sys import stdin
for line in stdin: print(line, end='')
不要再用 While True 搭配 try except 查一下網路很難嗎https://stackoverflow.com/questions/21235855/how-to-read-user-input-until-eof