Printing and prompting adds a mysterious extra space

jepler at unpythonic.net jepler at unpythonic.net
Sun Oct 2 00:09:48 CEST 2005


Use sys.stdout.write instead of print.  It will solve these problems you are
having.

If you really want to know what's going on, read the language manual,
http://docs.python.org/ref/print.html It explains the behavior of this extra
space, which is output by a successive 'print' statement.  The implementation
uses an attribute called 'softspace', which is described in
http://docs.python.org/lib/bltin-file-objects.html 

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051001/3d41a011/attachment.pgp>


More information about the Python-list mailing list