为什么在Mac OS上使用sys.platform时会显示"darwin"? [英] Why when use sys.platform on Mac os it print "darwin"?
本文介绍了为什么在Mac OS上使用sys.platform时会显示"darwin"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Python中,当我在Mac OS X上键入sys.platform时,输出为"darwin"?为什么会这样?
In Python, when I type sys.platform on the Mac OS X the output is "darwin"? Why is this so?
推荐答案
Because the core of Mac OS X is the Darwin OS.
在链接的WikiPedia页面上报价:
Quoting from the linked WikiPedia page:
Darwin构成了Mac OS X和iOS所基于的核心组件集.
Darwin forms the core set of components upon which Mac OS X and iOS are based.
即使您问OS X平台本身,其自身也会将其报告为达尔文":
Even the OS X platform itself reports itself as "Darwin" when you ask it:
$ uname
Darwin
Python仅使用相同的平台标识符.
Python merely uses that same platform identifier.
这篇关于为什么在Mac OS上使用sys.platform时会显示"darwin"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文