Pywin print w/o linefeed?
Spencer Ernest Doidge
spencer at efn.org
Tue Jan 21 15:09:45 EST 2003
Running Pythonwin, you get:
>>> def go():
print 'hello world'
print 'goodbye world'
>>> go()
hello world
goodbye world
Is there some way to make Python print a string without the linefeed
at the end? If there were <some instruction> to do that, then I could
do this:
>>> def go():
<some instruction> 'hello world'
<some instruction> 'goodbye world'
>>> go()
hello worldgoodbye world
I know that I could accumulate a string and then make one print statement,
but is there some other way? For those who remember Pascal, WRITELN corresponds
to Python's print. Is there a Python way to implement the equivalent of Pascal'sWRITE?
--
Spencer Doidge
More information about the Python-list
mailing list