gpt4 book ai didi

linux - 所有主要发行版的 platform.linux_distribution() 输出

转载 作者:太空宇宙 更新时间:2023-11-04 12:26:24 24 4
gpt4 key购买 nike

if [DISTRO,VERS,ARCH] = platform.linux_distribution()

我只需要知道不同发行版的 DISTRO 是什么。我正在运行 arch,所以我当然有。我也有openuse。我需要 ubuntu/debian、fedora、RHEL、sorcerer linux、slackware、gentoo 和您能想到的任何其他软件的输出。

如果不删除我的 arch 安装(在 32GB 闪存驱动器上运行),我无法安装其他发行版来测试它。

最佳答案

查看platform.py源代码:

_supported_dists = (
'SuSE', 'debian', 'fedora', 'redhat', 'centos',
'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo',
'UnitedLinux', 'turbolinux', 'arch', 'mageia')

请注意,您几乎总是最好检查您需要的功能/程序/库,而不是检查平台。

也许 Python 维护者也这么想,因为 linux_distribution()deprecated从 Python 3.5 开始,将在 Python 3.7 中删除。

关于linux - 所有主要发行版的 platform.linux_distribution() 输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44499081/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com