No newline using printf

Johnny Lee johnnyandfiona at hotmail.com
Thu Sep 15 22:40:39 EDT 2005


Roy Smith wrote:
>
> 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))

here is the output of my machine:

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

Why the prompt followed after the output? Maybe it's not as expected.




More information about the Python-list mailing list