I have to get the Linux distribution name from a Python script. There is a dist
method in the platform module:
import platform
platform.dist()
But under my Arch Linux it returns:
>>> platform.dist()
('', '', '')
Why? How can I get the name?
PS. I have to check whether the distribution is Debian-based.
Update: I found here Python site, that dist() is deprecated since 2.6.
>>> platform.linux_distribution()
('', '', '')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…