vt102 implements a subset of the vt102 specification (the subset that should be most useful for use in software). Two classes: stream, which parses the command stream and dispatches events for commands, and screen which, when used with a stream maintains a buffer of strings representing the screen of a terminal.
Why would you ever want to use this?
Screen scraping.
Cheating at nethack (I swear to god I will ascend)
Chicks dig terminals, and err… VT?
Here’s a quick example:
>>> from vt102 import screen, stream
>>> st = stream()
>>> sc = screen((10, 10))
[" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "]
>>> sc.attach(st)
>>> st.process("Text goes here")
>>> repr(sc)
["Text goes ",
"here ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "]
>>> st.process("\x1b[H\x1b[K")
>>> repr(sc)
[" ",
"here ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "]
Metadata
Release files for vt102 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vt102-0.2.1.tar.gz | 10.7 kB | Details |
Release files / vt102-0.2.1.tar.gz
| Download URL | vt102-0.2.1.tar.gz |
|---|---|
| Size | 10.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ba9b5230cd438ebcfbc26411d5f6bd95c4c20b0269c5d836b5f816fd83768d0
|
|
BLAKE2b-256 checksum How to use checksums |
af29c09ab0294922601095e61f68a0979bda9d15a52a6d8970c0345680e881c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |