platform模块可以获取操作系统的相关信息。

>>> platform.system()   #获取系统名称
'Linux'
>>> platform.architecture() #获取系统位数
('64bit', 'ELF')
>>> platform.platform() #获取操作系统名称及版本号
'Linux-2.6.32-696.6.3.el6.x86_64-x86_64-with-centos-6.8-Final'
>>> platform.uname() #汇总信息
uname_result(system='Linux', node='zww', release='2.6.32-696.6.3.el6.x86_64', version='#1 SMP Wed Jul 12 14:17:22 UTC 2017', machine='x86_64', processor='x86_64')

python3之platform模块的更多相关文章

  1. python基础系列教程——Python3.x标准模块库目录

    python基础系列教程——Python3.x标准模块库目录 文本 string:通用字符串操作 re:正则表达式操作 difflib:差异计算工具 textwrap:文本填充 unicodedata ...

  2. python3.7 sys模块

    #!/usr/bin/env python __author__ = "lrtao2010" #python3.7 sys模块 #sys模块负责程序与python解释器的交互,提供 ...

  3. python之platform模块

    python之platform模块 ^_^第三个模块从天而降喽!! 函数列表 platform.system() 获取操作系统类型,windows.linux等 platform.platform() ...

  4. Python第十一天 异常处理 glob模块和shlex模块 打开外部程序和subprocess模块 subprocess类 Pipe管道 operator模块 sorted函数 os模块 hashlib模块 platform模块 csv模块

    Python第十一天    异常处理  glob模块和shlex模块    打开外部程序和subprocess模块  subprocess类  Pipe管道  operator模块   sorted函 ...

  5. platform模块

    import platform ''' python中,platform模块给我们提供了很多方法去获取操作系统的信息 如: import platform platform.platform() #获 ...

  6. Python3之turtle模块的使用

    Python3之turtle模块的使用     直接扣代码就行: import turtle as t t.pensize(4) t.hideturtle() t.colormode(255) t.c ...

  7. python 模块之platform模块(基本了解)

    # -*- coding: cp936 -*-#python 27#xiaodeng#python 模块之platform模块(基本了解)#获取底层平台的识别数据 #知道该模块用途即可,需要使用时直接 ...

  8. Python3:Requests模块的异常值处理

    Python3:Requests模块的异常值处理 用Python的requests模块进行爬虫时,一个简单高效的模块就是requests模块,利用get()或者post()函数,发送请求. 但是在真正 ...

  9. Python3中正则模块re.compile、re.match及re.search函数用法详解

    Python3中正则模块re.compile.re.match及re.search函数用法 re模块 re.compile.re.match. re.search 正则匹配的时候,第一个字符是 r,表 ...

随机推荐

  1. Java-多态经典例子

    public class A { public String show(D obj) { return ("A and D"); } public String show(A ob ...

  2. Azure Pipelines-部署代理问题

    使用Azure Pipelines时代理脚本一直不成功,根据官方提示,可以使用下方的注册脚本自动执行代理 实际执行过程中,经常是无法执行完成,仔细阅读脚本,发现该脚本一共做了如下几步: 1.下载代理  ...

  3. ELK日志系统介绍

    ELK介绍 需求背景: 业务发展越来越庞大,服务器越来越多 各种访问日志.应用日志.错误日志量越来越多,导致运维人员无法很好的去管理日志 开发人员排查问题,需要到服务器上查日志,不方便 运营人员需要一 ...

  4. 11.全局变量(static)

    1.数组 数组名是常量 2. 指针数组 4.局部变量 (1).作用域 作用的范围: (2).普通局部变量 在{}内定义: 只有执行到定义变量的这个语句,系统才会给这个变量分配空间. 当离开{},这个非 ...

  5. linux获取网络信息函数

    获取IP地址 int sys_getIP(char *ip_addr) { ] = {"ifconfig eth0 | grep inet | cut -d: -f2 | cut -d' ' ...

  6. 【托业】【全真题库】TEST3-语法题

    101. sales representative 销售代表 keep one's promise with 遵守对……的诺言,信守对……的承诺 107. express interest in 表现 ...

  7. MySQL中的EXPLAIN

    使用EXPLAIN加上SELECT语句可以获取优化器的查询执行计划 MySQL会在查询上设置一个标记,当执行查询时,这个标记会返回关于在执行计划中每一步的信息,而不是执行它.它会返回一行或多行信息,一 ...

  8. [PCL]模型拟合方法——随机采样一致性

    SACSegmentation封装了多种Ransac方法,包括: RandomSampleConsensus, LeastMedianSquares, MEstimatorSampleConsensu ...

  9. mipush ionic3 线上push

    <dict> <key>aps-environment</key> <string>production</string> </dic ...

  10. Visual Studio 的插件及常用快捷键_ 系统Ubuntu16.04

    安装在 Ubuntu 的系统上 1, 常用的快捷键 [1] 调出终端: Ctrl + `(反引号); [2] 调出插件安装界面: Ctrl + P (打开插件面板) ---> 输入  ext i ...