No newline using printf

Roy Smith roy at panix.com
Fri Sep 16 02:45:50 CEST 2005


In article <1126831050.903747.13040 at z14g2000cwz.googlegroups.com>,
 "Samuel" <knipknap at gmail.com> wrote:
 
> How can I print a word without appending a newline character? Appending
> a "," to the print statement only substitutes the newline for a space,
> which is not what I am looking for.

For closer control over output, use the write() function.  You want 
something like:

import sys
for i in range(3):
   sys.stdout.write (str(i))



More information about the Python-list mailing list