Is there any pythonic way to determine OS distribution/flavor?
cat /etc/issue shows me following -- [its CentOS 5.6]
[root@localhost Abhishek]# cat /etc/issue
CentOS release 5.6 (Final)
Kernel \r on an \m
Is there any pythonic way to determine OS distribution/flavor?
cat /etc/issue shows me following -- [its CentOS 5.6]
[root@localhost Abhishek]# cat /etc/issue
CentOS release 5.6 (Final)
Kernel \r on an \m
 
    
    Use sys.platform() to get the platform.
Or for more detailed information use platform.platform()
>>> import platform
>>> print platform.linux_distribution()
('Ubuntu', '12.04', 'precise')
Note: platform.linux_distribution() has been deprecated since Python 3.5, and will be removed in Python 3.7.
 
    
    