Stupid question: 'print' without spaces?

Jon Ribbens jon+python-list at unequivocal.co.uk
Tue Sep 19 16:18:11 EDT 2000


Mikael Olofsson <mikael at isy.liu.se> wrote:
>  >  it with print, what is the usual work-around? I could do something like
>  >  'echo = sys.stdout.write' but I'd rather find out what you're *supposed*
>  >  to do ;-)
> 
>   http://www.faqts.com/knowledge-base/view.phtml/aid/4465/fid/538

Thanks for your reply. After investigating, the following explains my
confusion:

  print sys.stdout.softspace, sys.stdout.softspace
  0 1

I think that the documentation for softspace (doc/lib/bltin-file-objects.html)
could do with mentioning that softspace is a magic variable which changes by
itself rather than a user option flag, which is what it currently seems to
imply.

'echo = sys.stdout.write' it is then, I guess. This is really nasty :(

Cheers


Jon



More information about the Python-list mailing list