python之platform模块
python之platform模块
^_^第三个模块从天而降喽!!
函数列表
platform.system()获取操作系统类型,windows、linux等platform.platform()获取操作系统,Darwin-9.8.0-i386-32bitplatform.version()获取系统版本信息 6.2.0platform.mac_ver()platform.win32_ver()('post2008Server', '6.2.9200', '', u'Multiprocessor Free')
示例
>>> import platform
>>> platform.system()
'Linux'
>>> platform.platform()
'Linux-4.2.0-27-generic-x86_64-with-Ubuntu-14.04-trusty'
>>> platform.version()
'#32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016'
>>> platform.mac_ver()
('', ('', '', ''), '')
>>> platform.win32_ver()
('', '', '', '')
sys.platform各平台的的返回值
| column | column |
|---|---|
| 平台 | 值 |
| Linux (2.x and 3.x) | 'linux2' |
| Windows | 'win32' |
| Windows/Cygwin | 'cygwin' |
| Mac OS X | 'darwin' |
| OS/2 | 'os2' |
| OS/2 EMX | 'os2emx' |
| RiscOS | 'riscos' |
| RiscOS | 'riscos' |
| AtheOS | 'atheos' |
python之platform模块的更多相关文章
- python使用platform模块获取系统环境并去除换行符
近来在porting一个网站,企图拿到这个网站的数据来做分析.为了支持多系统环境的正常运行.需要知道当前系统环境的是什么OS? 1.python内置platform库.可以很方便得到当前系统环境时什么 ...
- Python第十一天 异常处理 glob模块和shlex模块 打开外部程序和subprocess模块 subprocess类 Pipe管道 operator模块 sorted函数 os模块 hashlib模块 platform模块 csv模块
Python第十一天 异常处理 glob模块和shlex模块 打开外部程序和subprocess模块 subprocess类 Pipe管道 operator模块 sorted函 ...
- python 模块之platform模块(基本了解)
# -*- coding: cp936 -*-#python 27#xiaodeng#python 模块之platform模块(基本了解)#获取底层平台的识别数据 #知道该模块用途即可,需要使用时直接 ...
- Python platform 模块
Python platform 模块 platform 模块用于查看当前操作系统的信息,来采集系统版本位数计算机类型名称内核等一系列信息. 使用方法: import platform # 获取操作系统 ...
- python之sys模块详解
python之sys模块详解 sys模块功能多,我们这里介绍一些比较实用的功能,相信你会喜欢的,和我一起走进python的模块吧! sys模块的常见函数列表 sys.argv: 实现从程序外部向程序传 ...
- 学习PYTHON之路, DAY 6 - PYTHON 基础 6 (模块)
一 安装,导入模块 安装: pip3 install 模块名称 导入: import module from module.xx.xx import xx from module.xx.xx impo ...
- Python学习——struct模块的pack、unpack示例
he struct module includes functions for converting between strings of bytes and native Python data t ...
- python之sys模块
38.python的sys模块: 用于提供对Python解释器相关的操作: 1 2 3 4 5 6 7 8 9 sys.argv 命令行参数List,第一个元素是程序本身路径 sy ...
- 【Python之路】第六篇--Python基础之模块
模块,用一砣代码实现了某个功能的代码集合. 类似于函数式编程和面向过程编程,函数式编程则完成一个功能,其他代码用来调用即可,提供了代码的重用性和代码间的耦合.而对于一个复杂的功能来,可能需要多个函数才 ...
随机推荐
- Python从破门而入到夺门而出
MD版网盘备份: 链接: https://pan.baidu.com/s/1kVJNRSz 密码: agxt 基于<简明Python教程> 一.Python概览 1.使用PyCharm是非 ...
- 1 python大数据挖掘系列之基础知识入门
preface Python在大数据行业非常火爆近两年,as a pythonic,所以也得涉足下大数据分析,下面就聊聊它们. Python数据分析与挖掘技术概述 所谓数据分析,即对已知的数据进行分析 ...
- BootLoader的架构设计
@注:黄色部分代表根据不同的开发板进行处理.
- 解决ubuntu16.04软件中心闪退的问题
依次执行下列命令 sudo apt-get update sudo apt-get dist-upgrade sudo apt-get install --reinstall software-cen ...
- vector it->和*it
//每次写代码总是被迭代器的iter->和*iter弄晕,主要是被protobuf弄晕了 #include <vector> struct test{ test(){ memset( ...
- Oracle备库TNS连接失败的分析
今天在测试12c的temp_undo的时候,准备在备库上测试一下,突然发现备库使用TNS连接竟然失败. 抛出的错误如下: $ sqlplus sys/oracle@testdb as sysdba S ...
- api签名
当你提交以上信息时,办公逸将发送GET请求到填写的URL,GET请求将携带四个参数, 参数 描述 是否必带 signature 办公逸签名,signature结合了企业填写的token,请求中的tim ...
- applicationContext.xml
<bean id="dataSource" parent="parentDataSource"> <property name="u ...
- mysql-开启慢查询&所有操作记录日志
在运营网站的过程中,可能会遇到网站突然变慢的问题,一般情况下和 MySQL 慢有关系,可以通过开启慢查询,找到影响效率的 SQL ,然后采取相应的措施.下面介绍一下如何开启慢查询: 1.开启慢查询 找 ...
- jexus5.8.2 linux x64通用版[未集成mono] 配置https
一.找到mono安装位置 sudo find / -name mono 二.首先查看"/lib"或"/usr/lib"等系统库文件夹中是否有SSL库文件的名字, ...