how to do draw pattern with python?

Peter Otten __peter__ at web.de
Fri Sep 21 13:29:02 EDT 2012


Ismael Farfán wrote:

> 2012/9/21 Peter Otten <__peter__ at web.de>:
>> echo.hping at gmail.com wrote:
>>
>>     print "\x1b[2J\x1b[0;0H" # optional
> 
> Nice code : )
> 
> Could you dissect that weird string for us?
> 
> It isn't returning the cursor to (0,0), it's just like executing
> clear(1), and looks like those line coloring scape sequences for bash.

"\x1b[2J" or ESC [2J should clear the screen and

"\x1b[1;1H" or ESC [1;1H should move the cursor to the origin (I got that 
wrong in the previous post)

There may be other problems -- I stopped reading

http://en.wikipedia.org/wiki/ANSI_escape_code

as soon as I got the desired effect (scrolling) in konsole.




More information about the Python-list mailing list