【发布时间】:2014-04-17 06:48:34
【问题描述】:
有什么方法可以检查我在 python 2.7 上运行的平台? 例如使用平台模块:
import platform
print platform.system()
print platform.release()
我明白了:
Linux
2.6.32-312-ec2
但是使用 linux 命令我可以准确地了解我正在运行的平台:
import command
print commands.getoutput('cat /etc/issue')
.
Debian GNU/Linux 6.0 \n \l
在 python 中有没有其他方法可以知道我正在运行 Debian GNU Linux 6.0?
【问题讨论】:
-
sys.platorm带给你什么? -
python -mplatform或platform.platform()在代码中
标签: python python-2.7 operating-system