Manual
If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, EOFError is raised. Example:
>>>
>>> s = input('--> ')
--> Monty Python's Flying Circus
>>> s
"Monty Python's Flying Circus"
If the readline module was loaded, then input() will use it to provide elaborate line editing and history features.
直译
如果出现prompt参数,它将不后缀换行符写入到标准输出。随后函数根据输入读取一行,将它转化为字符串(去掉尾缀换行符),并返回该值。当读入发生EOF时,引发EOFError。例如:
>>>
>>> s = input('--> ')
--> Monty Python's Flying Circus
>>> s
"Monty Python's Flying Circus"
如果加载readline模块,那么input()将会使用它来提供详细的行编辑和历史特征。