Checking for X availability

Dan Stromberg strombrg at dcs.nac.uci.edu
Wed Jan 12 00:20:35 EST 2005


On Tue, 11 Jan 2005 03:32:01 -0800, Flavio codeco coelho wrote:

> I have a program that uses pythondialog for its UI.
> 
> Pythondialog is a wrapper of the shell dialog and xdialog libs.
> 
> But I would like for it to switch between using Dialog ( when X is not
> available )  and xdialog (when X is available)
> 
> So my question is: how can I check for the availability of X? i.e.,
> How will my program know if its running in a text only console or in
> console window over X?
> 
> thanks,
> 
> Flávio

If there's interest, I could make available my "pdialog" module, which is
also a wrapper around *dialog, but uses X when available, and curses when
it is not.




More information about the Python-list mailing list