Re: A simple way to print few line stuck to the same position

2011-06-07 Thread TheSaint
Hans Mulder wrote: > If you use curses, you must initialize it by calling curses.initscr(), > which returns a "WindowObject" representing the konsole window. To > put things on the screen, you call methods on this object. Keep in > mind that a "window" in curses jargon is just a rectangle inside

Re: A simple way to print few line stuck to the same position

2011-06-05 Thread Hans Mulder
On 5/06/11 05:40:17, Sarcar, Shourya C (GE Healthcare) wrote: A way to do this on DOS/Windows console would be: import sys for r in range(0,2**16): line = "Count : %d" % r sys.stdout.write(line) sys.stdout.flush() # do something that consumes time backup =

RE: A simple way to print few line stuck to the same position

2011-06-04 Thread Sarcar, Shourya C (GE Healthcare)
Mulder Sent: Sunday, June 05, 2011 4:31 AM To: python-list@python.org Subject: Re: A simple way to print few line stuck to the same position On 4/06/11 13:14:05, TheSaint wrote: > Hans Mulder wrote: >> A minimalist solution would be to print the labels ("This count", >>

Re: A simple way to print few line stuck to the same position

2011-06-04 Thread Hans Mulder
On 4/06/11 13:14:05, TheSaint wrote: Hans Mulder wrote: A minimalist solution would be to print the labels ("This count", etc.) only once, and position the cursor after it to update the report. Generally a good point. Similar sequences are working for coloring and formatting text. As I sa

Re: A simple way to print few line stuck to the same position

2011-06-04 Thread TheSaint
Hans Mulder wrote: > A minimalist solution would be to print the labels ("This count", etc.) > only once, and position the cursor after it to update the report. Generally a good point. Similar sequences are working for coloring and formatting text. I don't know whether the program would behave t

Re: A simple way to print few line stuck to the same position

2011-06-03 Thread Hans Mulder
On 3/06/11 13:00:22, TheSaint wrote: I'd like to show 4~6 line of report and refreshing periodically all of them, avoiding to scroll down. example: this count 50 Second time 90 following line 110 another line xxx The lines should remain on their position and update their data. The quick and

Re: A simple way to print few line stuck to the same position

2011-06-03 Thread Steven D'Aprano
On Fri, 03 Jun 2011 19:00:22 +0800, TheSaint wrote: > Steven D'Aprano wrote: > >> def spinner(): >> chars = '|/-\\' > > Not exactly. > I'd like to show 4~6 line of report and refreshing periodically all of > them, avoiding to scroll down. You have to use the curses module for that. -- Steve

Re: A simple way to print few line stuck to the same position

2011-06-03 Thread TheSaint
Steven D'Aprano wrote: > def spinner(): > chars = '|/-\\' Not exactly. I'd like to show 4~6 line of report and refreshing periodically all of them, avoiding to scroll down. example: this count 50 Second time 90 following line 110 another line xxx The lines should remain on their position and u

Re: A simple way to print few line stuck to the same position

2011-06-02 Thread Steven D'Aprano
On Thu, 02 Jun 2011 21:22:40 +0800, TheSaint wrote: > Hello > I studying some way to print few line in the console that won't scroll > down. If was for a single line I've some idea, but several line it may > take some vertical tab and find the original first position. I don't > know anything about