Re: Request for stdwin feature - tty accomodation

Guido.van.Rossum@cwi.nl
Sat, 17 Sep 1994 10:28:52 +0200

> python such that it runs under, eg, X or character terminals, but not
> both. It seems like it would not be hard to arrange things so that
> the window-system and character-terminal versions are both accessible
> to the interpreter, and the python module does the job of
> distinguishing the right one to load at import time.

Unfortunately, both library versions define the same set of extenrals
(roughly) so they can't easily be linked into the same binary. There
may be some hack to globally rename everything but you'd have to have
two versions of stdwinmodule.c too. Not easy I think.

Using dynamic loading, of course, you can do the following: make two
binaries of stdwinmodule.c, with different names (you'll have to
modify the source minimally to change the module names). Support we
call them stdwin_x11 and stdwin_alfa. Then you can write a simple
module in Python called stdwin which tests for the presence of DISPLAY
in the environment (say) and then does a from stdwin_... import *.

--Guido van Rossum, CWI, Amsterdam <mailto:Guido.van.Rossum@cwi.nl>
<http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>