Get Common OS name of Linux Python
Question: I am trying to get Linux distro name like centos, fedora, ubuntu, SuSE etc in
python.  
I made use of platform module.  
My code is

    
    
    import platform
    version = platform.platform(aliased=0)
    version = version.split('-with-',1)[1].split('-',1)[0]
    print version
    

It gives me the desired output. But is there any simpler way other than this,
or any module which gives me the name directly?


Answer: Try this:

    
    
    >>> import platform
    >>> platform.linux_distribution()
    ('Red Hat Enterprise Linux Server', '6.6', 'Santiago')
    

