Determining Presence Of GUI Support

Fernando Pérez fperez528 at yahoo.com
Sat Nov 9 03:11:23 EST 2002


Tim Daneliuk wrote:

> Is there a portable method of determining whether the current runtime
> environment supports a GUI or text-based interface?  I would like to
> write a single program which autosenses the presentation environment
> and works accordingly.

In short, no. Your code could be running, for example, under the Xvfb X 
server. It's a 'virtual' server which doesn't actually display anything. It's 
a fantastic tool for many purposes, precisely because it fools any program 
into thinking it's running under normal X, while it isn't. 

I'm sure others can point to a myriad other situations where your code won't 
be able to identify what the user is actually seeing.

Cheers,

f.



More information about the Python-list mailing list