一个用于检测操作系统、其版本、架构等的库。
项目描述
sys-detection
https://pypi.ac.cn/project/sys-detection/
允许识别当前操作系统,这在构建和打包跨平台软件时很有帮助。
作为模块使用
>>> from sys_detection import local_sys_conf
>>> local_sys_conf()
<sys_detection.SysConfiguration system='Linux' architecture='x86_64' linux_os_release={'NAME': 'CentOS Stream', 'VERSION': '8', 'ID': 'centos', 'ID_LIKE': 'rhel fedora', 'VERSION_ID': '8', 'PLATFORM_ID': 'platform:el8', 'PRETTY_NAME': 'CentOS Stream 8', 'ANSI_COLOR': '0;31', 'CPE_NAME': 'cpe:/o:centos:centos:8', 'HOME_URL': 'https://centos.org/', 'BUG_REPORT_URL': 'https://bugzilla.redhat.com/', 'REDHAT_SUPPORT_PRODUCT': 'Red Hat Enterprise Linux 8', 'REDHAT_SUPPORT_PRODUCT_VERSION': 'CentOS Stream'} at 0x7f0123456789>
>>> local_sys_conf().id_for_packaging()
'centos8-x86_64'
>>> local_sys_conf().id_for_packaging(mid_part=['moreinfo'])
'centos8-moreinfo-x86_64'
>>> local_sys_conf().id_for_packaging(separator='_')
'centos8_x86_64'
命令行使用
python3 -m sys_detection
输出
centos8-x86_64
项目详情
关闭
sys_detection-1.3.4.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 0a8d325a16e5aa98db1eb1f91d46341889bdc8fb6c7b46510c9e56957ba7a895 |
|
MD5 | 28407203ec8076c370f5882a1b439f41 |
|
BLAKE2b-256 | 8eba9cd0b38af4ef155fb0c15d714ed77f6a528a80123ff0ef8e13ef31f43e04 |