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.

Filename, size & hash SHA256 hash help File type Python version Upload date
vt102-0.5.tar.gz (12.1 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page