help with printing to stdout...

Discussion in 'Python' started by Daniel Dalton, Mar 8, 2009.

  1. Hi,

    I've got a program here that prints out a percentage of it's
    completion. Currently with my implimentation it prints like this:
    0%
    1%
    2%
    3%
    4%

    etc taking up lots and lots of lines of output... So, how can I make it
    write the percentage on the same line eg.
    while working:
    print percent
    every time the line print percent is ran it should delete the old
    percentage from the screen, replacing it with the new one, so as to only
    use up one line... Basically I'm just printing a string of text to the
    screen and every time my print command is ran I would like the old text
    to be removed and my new text added (talking about the one line of the
    screen here)... This is a command line program, under linux...

    Thanks,

    Daniel.
     
    Daniel Dalton, Mar 8, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jody Burgess
    Replies:
    2
    Views:
    557
    George Kinney
    Jul 17, 2004
  2. Elad
    Replies:
    0
    Views:
    437
  3. Chris Rebert

    Re: help with printing to stdout...

    Chris Rebert, Mar 8, 2009, in forum: Python
    Replies:
    1
    Views:
    831
    Lie Ryan
    Mar 8, 2009
  4. Andreas S
    Replies:
    3
    Views:
    289
    Eric Hodel
    Dec 9, 2006
  5. Replies:
    2
    Views:
    384
    A. Sinan Unur
    Dec 7, 2005
Loading...

Share This Page