doing successive prints without space in between

Dave Kuhlman dkuhlman at rexx.com
Fri Jul 2 16:18:43 EDT 2004


Jon Perez wrote:

> I'd like to print a series of successive periods as a
> progress status in a command line script using python.
> Unforutnately, if I do a series of successive
> 
> print ".",
> 
> I get a space in between.  Is there any way to avoid
> this?

    import sys
    
    sys.stdout.write('.')

The print command sends its output to sys.stdout (which you can
customize, by the way, by replacing sys.stdout with an instance of
a class containing a 'write' method; see
http://docs.python.org/lib/module-sys.html)

Dave

-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman



More information about the Python-list mailing list