Re: Using print with format to stdout generates unwanted space

2005-06-21 Thread Michael Hoffman
[Tim Williams] >>For quick and simple removal of the extra space, append a '\b' >>backspace character to your output "string" [Jorgen Grahn] > For things that are only ever to be viewed on the terminal, yes. > But this does, of course, print an actual backspace character. > If you feed this outpu

Re: Using print with format to stdout generates unwanted space

2005-06-21 Thread Jorgen Grahn
On Tue, 21 Jun 2005 00:08:03 +0100, Tim Williams (gmail) <[EMAIL PROTECTED]> wrote: ... > For quick and simple removal of the extra space, append a '\b' > backspace character to your output "string" For things that are only ever to be viewed on the terminal, yes. But this does, of course, print

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Tim Williams (gmail)
On 6/20/05, Michael Hoffman <[EMAIL PROTECTED]> wrote: > Paul Watson wrote: > > > While printf() does tightly control formatting in C, it does not in > > Python. > > There is no printf() in Python. You should not think of print as being a > Python version of printf. For quick and simple removal

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Michael Hoffman
Paul Watson wrote: > While printf() does tightly control formatting in C, it does not in > Python. There is no printf() in Python. You should not think of print as being a Python version of printf. -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Paul Watson
Thanks for all replies. Ok. I agree. While printf() does tightly control formatting in C, it does not in Python. Using write() can be used to output with no changes to the data. "Tim Hoffman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi Paul > > Based on your description

Re: Using print with format to stdout generates unwanted space

2005-06-20 Thread Tim Hoffman
Hi Paul Based on your description of what you want to do, print is probably not the correct method of controlling output format. You should use write() method of the file handle to get unadulterated output. print is working as documented . From the Python 2.3 documentation, Section 6.6 The P

Re: Using print with format to stdout generates unwanted space

2005-06-19 Thread John Roth
Don't use print, write directly to sys.stdout. Print is not intended for precise output formatting; it's intended for quick outputs that are useable most of the time. John Roth "Paul Watson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > #!/usr/bin/env python > > # Using a prin