How to I print without newline ?

David Stockwell winexpert at hotmail.com
Thu May 27 11:54:12 EDT 2004



>>>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" <winexpert at hotmail.com>
>To: fowlertrainer at anonym.hu, python-list at python.org
>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: "fowlertrainer at anonym.hu" <fowlertrainer at anonym.hu>
>>To: python-list at python.org
>>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/





More information about the Python-list mailing list