Module/lib for controlling a terminal program using redrawing?

Paul Rubin no.email at nospam.invalid
Sat Mar 14 14:00:37 EDT 2015


Dave Angel <davea at davea.name> writes:
>> Is there a module/library that can help me with this?
> https://docs.python.org/3/howto/curses.html

That's the opposite of what the OP wanted.  Curses generates the escape
codes and so on to draw your desired stuff on the terminal.  The OP
wants a screen scraper, something that takes the escape codes generated
by another program and interprets them to figure out what the screen is
supposed to look like.

The classic program that does this is Rog-o-matic.  I don't happen to
know of any Python code that does it but the search terms "python ansi
screen scraping" find some results that might be worth looking into.  It
also shouldn't be all that terribly hard to implement.

Leaving out the "ansi" keyword finds mostly HTML scrapers which aren't
what is wanted.  Trying other terminal types like "vt100" might find
desirable stuff though.



More information about the Python-list mailing list