Sujet : RE: Terminal Emulator
De : <avi.e.gross (at) *nospam* gmail.com>
Groupes : comp.lang.pythonDate : 14. May 2024, 23:10:41
Autres entêtes
Message-ID : <mailman.4.1715721049.2909.python-list@python.org>
References : 1 2 3
User-Agent : Microsoft Outlook 16.0
The topic was to re-invent the wheel yet again and create a terminal
emulator.
I hesitate to say this but one approach is to consider the curses module as
described by our very own Alan Gauld in a book:
https://www.amazon.com/Programming-curses-Python-Alan-Gauld-ebook/dp/B091B85B77
The topic is how to make a terminal emulator and as Alan mentions, each kind
of terminal may accept various kinds of escape sequences. There are files
available the are normally used by curses to get a description of sorts of
the capabilities and details of a terminal like a VT100 that curses can use
to decide what stream of bytes to send to update a screen.
You might be able to use something similar, or better, to see what your
terminal emulator should emulate.
And, it may even be possible for you to emulate lots of terminals with the
same basic code.
-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=
gmail.com@python.org> On
Behalf Of Alan Gauld via Python-list
Sent: Tuesday, May 14, 2024 3:07 PM
To: Gordinator <
gordinator@gordinator.org>;
python-list@python.orgSubject: Re: Terminal Emulator
On 14/05/2024 18:44, Gordinator via Python-list wrote:
I wish to write a terminal emulator in Python. I am a fairly competent
Python user, and I wish to try a new project idea. What references can I
use when writing my terminal emulator? I wish for it to be a true
terminal emulator as well, not just a Tk text widget or something like
that.
The first thing is to decide which terminal. A VT100 is very different
from a 3270. And even a VT330 is quite different from a VT100 although
sharing a common subset of control codes. And if you start looking at
graphical terminals things get even more interesting!
The other thing to consider is whether it will be a standalone app or
a GUI component. If the latter do you want to expose your own API or
clone the manufacturers? Or both?!
Or you could make it an object that can be used both in GUIs and in
"robotic" or "batch" mode. So many options.
Most of the specs are available online and there must be dozens of
terminal emulators around written in C so you should have plenty
of sample code to study. Good luck!
-- Alan GAuthor of the Learn to Program web sitehttp://www.alan-g.me.uk/http://www.amazon.com/author/alan_gauldFollow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos-- https://mail.python.org/mailman/listinfo/python-list