Printing digits in one place

Tim Chase python.list at tim.thechases.com
Mon Nov 24 20:20:02 EST 2008


> Try repeatedly writing something like
> 
> "\r                                  \rBytes Transferred So Far %d" \
>       % count

Rather than backing up twice with \r, I'd just suggest

   "\rBytes Transferred So Far %d           " % count

or even

   "\rBytes Transferred So Far %d%s" % (count, ' '*20)

-tkc







More information about the Python-list mailing list