更新时间:2023-02-09 10:48:49
可以使用 sys
模块吗?如果需要,这可以解决问题。只需按Ctrl-D即可结束。
Can you use the sys
module? This will do the trick if you want. Just hit Ctrl-D to end it.
import sys
message = sys.stdin.readlines()
否则,这会回答您的问题: Python raw_input忽略换行符
Otherwise, this answers your question: Python raw_input ignore newline