RE: How to I print without newline ?

Discussion in 'Python' started by David Stockwell, May 27, 2004.


  1. >>>def try1(text):

    .... x = "\r%s" % text
    .... print x,
    ....
    >>>def series():

    .... try1("10")
    .... try1("999")
    ....
    >>>series()

    999

    Seems to work to put the \r first



    >From: "David Stockwell" <>
    >To: ,
    >Subject: RE: How to I print without newline ?
    >Date: Thu, 27 May 2004 15:22:05 +0000
    >
    >Hi,
    >
    >This might work:
    >
    >print "25\r",
    >
    >the \r would do a carriage return with no line feed.
    >the , would try to keep it on the same line.
    >
    >not sure though.
    >
    >
    >David Stockwell
    >-------
    >Cell: http://cellphone.duneram.com/index.html
    >Cam: http://www.duneram.com/cam/index.html
    >Tax: http://www.duneram.com/index.html
    >
    >
    >
    >
    >>From: "" <>
    >>To:
    >>Subject: How to I print without newline ?
    >>Date: Thu, 27 May 2004 17:06:17 +0200
    >>
    >>Hi !
    >>
    >>I want to print, but without newline. I want to create a progress for ftp,
    >>but the print is drop a newline for every percent.
    >>I want like this:
    >>
    >>0% 25% 50% 75% 100%
    >>
    >>But this happening:
    >>0%
    >>25%
    >>50%
    >>75%
    >>100%
    >>
    >>How to I prevent the newlines ?
    >>
    >>Thanx for help:
    >>FT
    >>
    >>
    >>--
    >>http://mail.python.org/mailman/listinfo/python-list

    >
    >_________________________________________________________________
    >MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
    >download! http://toolbar.msn.click-url.com/go/onm00200413ave/direct/01/
    >
    >
    >--
    >http://mail.python.org/mailman/listinfo/python-list


    _________________________________________________________________
    Watch LIVE baseball games on your computer with MLB.TV, included with MSN
    Premium! http://join.msn.click-url.com/go/onm00200439ave/direct/01/
     
    David Stockwell, May 27, 2004
    #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. Replies:
    4
    Views:
    579
    Chris Herborth
    May 28, 2004
  2. Ray Cote
    Replies:
    1
    Views:
    333
    Michael Geary
    May 27, 2004
  3. Karlo Lozovina
    Replies:
    2
    Views:
    400
    Karlo Lozovina
    Apr 16, 2006
  4. keto
    Replies:
    0
    Views:
    1,024
  5. David Cournapeau

    print a vs print '%s' % a vs print '%f' a

    David Cournapeau, Dec 30, 2008, in forum: Python
    Replies:
    0
    Views:
    390
    David Cournapeau
    Dec 30, 2008
Loading...

Share This Page