Puzzling input problem

Stephen R. Figgins fig at monitor.net
Fri Mar 23 15:48:18 CET 2001

Kevin Cazabon wrote:
> How about using this instead:
> answer = raw_input("prompt string: ")

Yeah, that is how I would normally do it.  In this case, there were some
variables in the prompt string so I decided to it.

My question was not, "how do I use raw_input()?" It was, "why does the
space appear where it does?"

Alex supplied the answer.  When I followed the first print statement
with a comma, it set a softspace property on standard out. raw_input()
did not use or change this property when it modified the screen.  The
second print did, however, so it printed an extra space before the
second print.


More information about the Python-list mailing list