开源 企业版 高校版 私有云 模力方舟 AI 队友
代码拉取完成,页面将自动刷新
捐赠
捐赠前请先登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
1 Star 0 Fork 0

source-code-analysis/python3.8.1

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
已有帐号? 立即登录
文件
master
分支 (1)
master
master
分支 (1)
master
克隆/下载
克隆/下载
提示
下载代码请复制以下命令到终端执行
为确保你提交的代码身份被 Gitee 正确识别,请执行以下命令完成配置
初次使用 SSH 协议进行代码克隆、推送等操作时,需按下述提示完成 SSH 配置
1 生成 RSA 密钥
2 获取 RSA 公钥内容,并配置到 SSH公钥
在 Gitee 上使用 SVN,请访问 使用指南
使用 HTTPS 协议时,命令行会出现如下账号密码验证步骤。基于安全考虑,Gitee 建议 配置并使用私人令牌 替代登录密码进行克隆、推送等操作
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # 私人令牌
master
分支 (1)
master
python3.8.1
/
Doc
/
library
/
platform.rst
python3.8.1
/
Doc
/
library
/
platform.rst
platform.rst 8.36 KB
一键复制 编辑 原始数据 按行查看 历史
zhangweibo 提交于 2021年11月16日 09:46 +08:00 . git init

:mod:`platform` --- Access to underlying platform's identifying data

.. module:: platform
 :synopsis: Retrieves as much platform identifying data as possible.

.. moduleauthor:: Marc-André Lemburg <mal@egenix.com>
.. sectionauthor:: Bjorn Pettersen <bpettersen@corp.fairisaac.com>

Source code: :source:`Lib/platform.py`


Note

Specific platforms listed alphabetically, with Linux included in the Unix section.

Cross Platform

.. function:: architecture(executable=sys.executable, bits='', linkage='')

 Queries the given executable (defaults to the Python interpreter binary) for
 various architecture information.

 Returns a tuple ``(bits, linkage)`` which contain information about the bit
 architecture and the linkage format used for the executable. Both values are
 returned as strings.

 Values that cannot be determined are returned as given by the parameter presets.
 If bits is given as ``''``, the ``sizeof(pointer)`` (or
 ``sizeof(long)`` on Python version < 1.5.2) is used as indicator for the
 supported pointer size.

 The function relies on the system's :file:`file` command to do the actual work.
 This is available on most if not all Unix platforms and some non-Unix platforms
 and then only if the executable points to the Python interpreter. Reasonable
 defaults are used when the above needs are not met.

 .. note::

 On Mac OS X (and perhaps other platforms), executable files may be
 universal files containing multiple architectures.

 To get at the "64-bitness" of the current interpreter, it is more
 reliable to query the :attr:`sys.maxsize` attribute::

 is_64bits = sys.maxsize > 2**32


.. function:: machine()

 Returns the machine type, e.g. ``'i386'``. An empty string is returned if the
 value cannot be determined.


.. function:: node()

 Returns the computer's network name (may not be fully qualified!). An empty
 string is returned if the value cannot be determined.


.. function:: platform(aliased=0, terse=0)

 Returns a single string identifying the underlying platform with as much useful
 information as possible.

 The output is intended to be *human readable* rather than machine parseable. It
 may look different on different platforms and this is intended.

 If *aliased* is true, the function will use aliases for various platforms that
 report system names which differ from their common names, for example SunOS will
 be reported as Solaris. The :func:`system_alias` function is used to implement
 this.

 Setting *terse* to true causes the function to return only the absolute minimum
 information needed to identify the platform.

 .. versionchanged:: 3.8
 On macOS, the function now uses :func:`mac_ver`, if it returns a
 non-empty release string, to get the macOS version rather than the darwin
 version.


.. function:: processor()

 Returns the (real) processor name, e.g. ``'amdk6'``.

 An empty string is returned if the value cannot be determined. Note that many
 platforms do not provide this information or simply return the same value as for
 :func:`machine`. NetBSD does this.


.. function:: python_build()

 Returns a tuple ``(buildno, builddate)`` stating the Python build number and
 date as strings.


.. function:: python_compiler()

 Returns a string identifying the compiler used for compiling Python.


.. function:: python_branch()

 Returns a string identifying the Python implementation SCM branch.


.. function:: python_implementation()

 Returns a string identifying the Python implementation. Possible return values
 are: 'CPython', 'IronPython', 'Jython', 'PyPy'.


.. function:: python_revision()

 Returns a string identifying the Python implementation SCM revision.


.. function:: python_version()

 Returns the Python version as string ``'major.minor.patchlevel'``.

 Note that unlike the Python ``sys.version``, the returned value will always
 include the patchlevel (it defaults to 0).


.. function:: python_version_tuple()

 Returns the Python version as tuple ``(major, minor, patchlevel)`` of strings.

 Note that unlike the Python ``sys.version``, the returned value will always
 include the patchlevel (it defaults to ``'0'``).


.. function:: release()

 Returns the system's release, e.g. ``'2.2.0'`` or ``'NT'`` An empty string is
 returned if the value cannot be determined.


.. function:: system()

 Returns the system/OS name, e.g. ``'Linux'``, ``'Windows'``, or ``'Java'``. An
 empty string is returned if the value cannot be determined.


.. function:: system_alias(system, release, version)

 Returns ``(system, release, version)`` aliased to common marketing names used
 for some systems. It also does some reordering of the information in some cases
 where it would otherwise cause confusion.


.. function:: version()

 Returns the system's release version, e.g. ``'#3 on degas'``. An empty string is
 returned if the value cannot be determined.


.. function:: uname()

 Fairly portable uname interface. Returns a :func:`~collections.namedtuple`
 containing six attributes: :attr:`system`, :attr:`node`, :attr:`release`,
 :attr:`version`, :attr:`machine`, and :attr:`processor`.

 Note that this adds a sixth attribute (:attr:`processor`) not present
 in the :func:`os.uname` result. Also, the attribute names are different
 for the first two attributes; :func:`os.uname` names them
 :attr:`sysname` and :attr:`nodename`.

 Entries which cannot be determined are set to ``''``.

 .. versionchanged:: 3.3
 Result changed from a tuple to a namedtuple.


Java Platform

.. function:: java_ver(release='', vendor='', vminfo=('','',''), osinfo=('','',''))

 Version interface for Jython.

 Returns a tuple ``(release, vendor, vminfo, osinfo)`` with *vminfo* being a
 tuple ``(vm_name, vm_release, vm_vendor)`` and *osinfo* being a tuple
 ``(os_name, os_version, os_arch)``. Values which cannot be determined are set to
 the defaults given as parameters (which all default to ``''``).


Windows Platform

.. function:: win32_ver(release='', version='', csd='', ptype='')

 Get additional version information from the Windows Registry and return a tuple
 ``(release, version, csd, ptype)`` referring to OS release, version number,
 CSD level (service pack) and OS type (multi/single processor).

 As a hint: *ptype* is ``'Uniprocessor Free'`` on single processor NT machines
 and ``'Multiprocessor Free'`` on multi processor machines. The *'Free'* refers
 to the OS version being free of debugging code. It could also state *'Checked'*
 which means the OS version uses debugging code, i.e. code that checks arguments,
 ranges, etc.

 .. note::

 This function works best with Mark Hammond's
 :mod:`win32all` package installed, but also on Python 2.3 and
 later (support for this was added in Python 2.6). It obviously
 only runs on Win32 compatible platforms.

.. function:: win32_edition()

 Returns a string representing the current Windows edition. Possible
 values include but are not limited to ``'Enterprise'``, ``'IoTUAP'``,
 ``'ServerStandard'``, and ``'nanoserver'``.

 .. versionadded:: 3.8

.. function:: win32_is_iot()

 Return ``True`` if the Windows edition returned by :func:`win32_edition`
 is recognized as an IoT edition.

 .. versionadded:: 3.8


Mac OS Platform

.. function:: mac_ver(release='', versioninfo=('','',''), machine='')

 Get Mac OS version information and return it as tuple ``(release, versioninfo,
 machine)`` with *versioninfo* being a tuple ``(version, dev_stage,
 non_release_version)``.

 Entries which cannot be determined are set to ``''``. All tuple entries are
 strings.


Unix Platforms

.. function:: libc_ver(executable=sys.executable, lib='', version='', chunksize=16384)

 Tries to determine the libc version against which the file executable (defaults
 to the Python interpreter) is linked. Returns a tuple of strings ``(lib,
 version)`` which default to the given parameters in case the lookup fails.

 Note that this function has intimate knowledge of how different libc versions
 add symbols to the executable is probably only usable for executables compiled
 using :program:`gcc`.

 The file is read and scanned in chunks of *chunksize* bytes.

Loading...
举报
举报成功
我们将于2个工作日内通过站内信反馈结果给你!
请认真填写举报原因,尽可能描述详细。
请选择举报类型
取消
发送
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
编辑仓库简介
简介内容
主页
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/python_sourcecode/python3.8.1.git
git@gitee.com:python_sourcecode/python3.8.1.git
python_sourcecode
python3.8.1
python3.8.1
master
点此查找更多帮助

搜索帮助

评论
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册

AltStyle によって変換されたページ (->オリジナル) /