This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 jaylogan
收信人 jaylogan
日期 2011-03-07.17:22:22
SpamBayes Score 0.0040881946
Marked as misclassified
Message-id <1299518543.64.0.9351532362.issue11434@psf.upfronthosting.co.za>
In-reply-to
内容
Hello,

It is mentioned in the documentation for input() ( http://docs.python.org/py3k/library/functions.html#input ) that the newline is stripped from the end of the returned string. However, on Windows, it used to trim '\r\n'. Now it no longer trims '\r'.

See output below:

C:\>python
Python 3.2 (r32:88445, Feb 20 2011, 21:29:02) [MSC v.1500 32 bit (Intel)] on win32

>>> name = input("What's your name? ")
What's your name? Josh
>>> print(name)
Josh
>>> print(list(name))
['J', 'o', 's', 'h', '\r']
历史
日期 用户 动作 参数
2011-03-07 17:22:24jaylogan修改recipients: + jaylogan
2011-03-07 17:22:23jaylogan修改messageid: <1299518543.64.0.9351532362.issue11434@psf.upfronthosting.co.za>
2011-03-07 17:22:22jaylogan链接issue11434 messages
2011-03-07 17:22:22jaylogan创建