跳转到主要内容

一个用于检测操作系统、其版本、架构等的库。

项目描述

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 (8.9 kB 查看哈希值)

上传时间: 源代码

支持者

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面