Detecting OS and Window Manager

Andrew Wilkinson ajw126 at york.ac.uk
Wed Jun 5 20:53:21 CEST 2002


Hi,

I'm writing a program that integrates with a number of different OSes and
Window Managers (under Linux), but I need to check what the user is running.
I know that...

import os
if os.name == 'nt':

will tell me they're running NT. But under Linux I'd like to know if they
are running KDE or Gnome, does anyone know a (preferably) simple test for
this?

Thanks in advance
Andrew Wilkinson





More information about the Python-list mailing list