zoukankan      html  css  js  c++  java
  • python

    转载自:https://www.cnblogs.com/leomei91/p/7680954.html

    该模块用来访问平台相关属性。

    常见属性和方法

     

    平台架构

    platform.machine()

    返回平台架构。若无法确定,则返回空字符串。

    1
    2
    3
    4
    5
    >>> platform.machine()
    'AMD64'
     
    >>> platform.machine()
    'x86_64'

     

    网络名称(主机名)

    platform.node()

    返回计算机的网络名称(可能未被完全限定!)。如果无法确定该值,则返回空字符串。

    1
    2
    3
    4
    5
    6
    7
    #windows
    >>> platform.node()
    'office'
     
    #linux
    >>> platform.node()
    'abcxx'

     

    系统版本

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

    如果aliased为True,则该函数将使用不同平台的别名来报告与其常用名称不同的系统名称,例如SunOS将被报告为Solaris。 system_alias()函数用于实现。
    将terse设置为True会导致该功能仅返回识别平台所需的绝对最小信息。

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    >>> platform.platform()
    'Windows-8.1-6.3.9600-SP0'
    >>> platform.platform(aliased=True)
    'Windows-8.1-6.3.9600-SP0'
    >>> platform.platform(aliased=True,terse=True)
    'Windows-8.1'
    >>> platform.platform(aliased=True,terse=False)
    'Windows-8.1-6.3.9600-SP0'
     
    #linux
    >>> platform.platform()
    'Linux-2.6.32-642.13.1.el6.x86_64-x86_64-with-centos-6.8-Final'

     

    处理器名称

    platform.processor()

    返回处理器名称。

    1
    2
    3
    4
    5
    6
    >>> platform.processor()
    'Intel64 Family 6 Model 60 Stepping 3, GenuineIntel'
     
    #linux
    >>> platform.processor()
    'x86_64'

     

    系统名称

    platform.system()

    返回系统/操作系统名称,例如“Linux”,“Windows”或“Java”。如果无法确定该值,则返回空字符串。

    1
    2
    3
    4
    5
    6
    >>> platform.system()
    'Windows'
     
    #linux
    >>> platform.system()
    'Linux'
  • 相关阅读:
    layui timeline使用
    Java随机数使用
    Matlab信号处理工具箱函数
    高斯白噪声(white Gaussian noise,WGN)
    概率分布之间的距离度量以及python实现
    Wasserstein距离 和 Lipschitz连续
    线性分式变换(linear fractional transformation)
    算法的时间复杂度和空间复杂度-总结
    随机森林(Random Forest,简称RF)
    增强学习与马尔科夫决策过程
  • 原文地址:https://www.cnblogs.com/blitheG/p/8399554.html
Copyright © 2011-2022 走看看