Re: No newline using printf

2005-09-16 Thread Gary Herron
Samuel wrote: >Hello, > >I have been searching for an answer for almost two hours now and have >not found an answer. I want this code: > >for i in range(3): > print i # or whatever > >To produce this output: >012 > >How can I print a word without appending a newline character? Appending >a ","

Re: No newline using printf

2005-09-16 Thread Samuel
Thanks for your help, Guys. This works of course. -Samuel -- http://mail.python.org/mailman/listinfo/python-list

Re: No newline using printf

2005-09-16 Thread Sybren Stuvel
Johnny Lee enlightened us with: > Why the prompt followed after the output? Maybe it's not as > expected. Because it did what you ask of it: write "012" to stdout, and nothing else. Hence, no newline at the end, hence the prompt is on the same line. Sybren -- The problem with the world is stupid

Re: No newline using printf

2005-09-15 Thread Peter Hansen
Johnny Lee wrote: > 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

Re: No newline using printf

2005-09-15 Thread Johnny Lee
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>>>

Re: No newline using printf

2005-09-15 Thread Gustavo Picon
On Thu, 2005-09-15 at 17:37 -0700, Samuel wrote: > Hello, > > I have been searching for an answer for almost two hours now and have > not found an answer. I want this code: > > for i in range(3): > print i # or whatever > > To produce this output: > 012 > > How can I print a word without ap

Re: No newline using printf

2005-09-15 Thread Roy Smith
In article <[EMAIL PROTECTED]>, "Samuel" <[EMAIL PROTECTED]> 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 wr

Re: No newline using printf

2005-09-15 Thread Erik Max Francis
Samuel 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. Use sys.stdout.write directly. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.co

No newline using printf

2005-09-15 Thread Samuel
Hello, I have been searching for an answer for almost two hours now and have not found an answer. I want this code: for i in range(3): print i # or whatever To produce this output: 012 How can I print a word without appending a newline character? Appending a "," to the print statement only