Detecting OS and Window Manager

Andrew Wilkinson ajw126 at
Wed Jun 5 20:53:21 CEST 2002


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 == '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

Thanks in advance
Andrew Wilkinson

More information about the Python-list mailing list