zoukankan      html  css  js  c++  java
  • Python获得操作系统信息

    Python里里面有个platform模块,可以得到操作系统的相关信息
    import platform
    platform.machine()    # Returns the machine type, e.g. 'i386'

    platform.node()    # Returns the computer's network name

    platform.platform(aliased=0, terse=0)    # Returns a single string identifying the underlying platform

    platform.processor()    # Returns the (true) processor name

    platform.python_branch()    # Returns a string identifying the Python implementation branch.

    platform.python_build()    # Returns a tuple (buildno, builddate) stating the Python build number and date as strings.
       
    platform.python_compiler()    # Returns a string identifying the compiler used for compiling Python.

    platform.python_version()    # Returns the Python version as string 'major.minor.patchlevel'

    platform.release()    # Returns the system's release, e.g. '2.2.0' or 'NT'

    platform.system()    # Returns the system/OS name, e.g. 'Linux', 'Windows' or 'Java'.

    platform.uname()    # Fairly portable uname interface. Returns a tuple of strings (system,node,release,version,machine,processor) identifying the underlying platform.
           
    platform.win32_ver(release='', version='', csd='', ptype='')    # Get additional version information from the Windows Registry and return a tuple (version,csd,ptype) referring to version number, CSD level and OS type (multi/single processor).

    作者:Shane
    出处:http://bluescorpio.cnblogs.com
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    过采样算法之SMOTE
    4.4 spring-自定义标签的解析
    4.3 spring-嵌入式beans标签的解析
    4.2 spring-import 标签的解析;
    4.1 spring-alias 标签的解析;
    4.0 spring-注册解析的Bean
    3.9 spring-自定义标签解析
    3.8 spring
    3.8 spring-qualifier 子元素的使用与解析
    3.7 spring-property 子元素的使用与解析
  • 原文地址:https://www.cnblogs.com/bluescorpio/p/1739166.html
Copyright © 2011-2022 走看看