Skip to main content

Simple vt102 emulator, useful for screen scraping.

Project description

[vt102](http://github.com/samfoo/vt102) is an in memory vt1xx terminal emulator. It supports all the most common terminal escape sequences, including text attributes and color.

It’s an in memory vt1XX-compatible terminal emulator. The XX stands for a series video terminals, developed by [DEC](http://en.wikipedia.org/wiki/Digital_Equipment_Corporation) between 1970 and 1995. The first, and most famous one, was VT100 terminal, which is now a de-facto standard for all virtual terminal emulators. [vt102](http://github.com/samfoo/vt102) is one such emulator.

Why would you want to use a terminal emulator?

  • Screen scraping some terminal or curses app.

  • Writing your own graphical terminal emulator.

  • … seriously, that’s about it.

Here’s a quick example:

>>> from vt102 import screen, stream
>>> st = stream()
>>> sc = screen((10, 10))
>>> print(sc)
["          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          "]
>>> sc.attach(st)
>>> st.process("Text goes here")
>>> print(sc)
["Text goes ",
 "here      ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          "]
>>> st.process("\x1b[H\x1b[K")
>>> print(sc)
["          ",
 "here      ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          "]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vt102-0.5.tar.gz (12.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page