Paul Watson <[EMAIL PROTECTED]> wrote:

> It is clear that just using 'print' with variable names is relatively
> uncontrollable.  However, I thought that using a format string would 
> reign the problem in and give the desired output.
> 
> Must I resort to sys.stdout.write() to control output?

In general, yes, because print tries hard to separate with spaces the
things it is separately printing.  You can fight that by resetting
sys.stdout.softspace after each and every print, but that's harder than
just using sys.stdout.write.  So, you should use the right tool for the
job: print for simple output, often diagnostic in nature, where you
don't mind the spaces and/or newlines that implies; sys.stdout.write
when you do want to really control every aspect of the output.


Alex
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to