print foo, adds a space to beginning of next line?

George Young gry at ll.mit.edu
Wed Jun 6 14:59:04 EDT 2001


[python 2.1, intel linux]
def f():
     print 'what is your name: ',
     x=sys.stdin.readline()
     print 'what is your age: ',
     y=sys.stdin.readline()

f()
what is your name: mememe
 what is your age: 48

Why does it print a space at the beginning of the second line?

If I use sys.stdout.write('what is your name: ') instead, it
works fine.

-- 
Your mouse has moved.
Windows NT must be restarted for the change to take effect.
Reboot now?  [OK]



More information about the Python-list mailing list