Checking for X availability

Nils Nordman nino at nordman.org
Tue Jan 11 06:39:41 EST 2005


On Tue, Jan 11, 2005 at 03:32:01AM -0800, Flavio codeco coelho wrote:
> 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?

Well, one way to do it is to check whether the environment variable
DISPLAY is set (which it is when running under X, and should not be
otherwise).

Cheers,

-- 
Nils Nordman <nino at nordman.org>



More information about the Python-list mailing list