检测操作系统和Python版本
项目描述
安装
$ [sudo] pip install detect
功能
操作系统变量
变量 | 描述 |
---|---|
detect.freebsd |
如果是FreeBSD操作系统则为True |
detect.linux |
如果是Linux操作系统则为True |
detect.mac |
如果是MacOS操作系统则为True |
detect.osx |
如果是MacOS OS X操作系统则为True |
detect.windows |
如果是Windows操作系统则为True |
detect.cygwin |
如果检测到Cygwin则为True |
detect.unix |
如果是Unix操作系统(非Windows)则为True |
Python变量
变量 | 描述 |
---|---|
detect.py2 |
如果是python 2.x则为True |
detect.py3 |
如果是python 3.x则为True |
Docker
变量 | 描述 |
---|---|
detect.docker |
如果在Docker容器中运行则为True |