print "foo", without a space

Charles G Waldman cgw at
Thu Nov 11 16:11:30 CET 1999

Michael Hudson writes:
 > Mikael Johansson <mikael.johansson at helsinki.xx> writes:
 > > Hello All!
 > > 
 > > Is there another way of getting print to not make a newline than
 > > using:
 > >     print "foo",  ?
 > I think there's some way invloling sys.stdout.softspace, but I'm no
 > sure what. However...

Another option is to forego the "print" and use "sys.stdout.write()"
instead.  Conversion of the argument to a string is your
responsibility, and no extra spaces/newlines/etc are added to the

More information about the Python-list mailing list