#!/bin/python
#
import platform def TestPlatform():
print ("----------Operation System--------------------------")
#Windows will be : (32bit, WindowsPE)
#Linux will be : (32bit, ELF)
print(platform.architecture()) #Windows will be : Windows-XP-5.1.2600-SP3 or Windows-post2008Server-6.1.7600
#Linux will be : Linux-2.6.18-128.el5-i686-with-redhat-5.3-Final
print(platform.platform()) #Windows will be : Windows
#Linux will be : Linux
print(platform.system()) print ("--------------Python Version-------------------------")
#Windows and Linux will be : 3.1.1 or 3.1.3
print(platform.python_version()) def UsePlatform():
sysstr = platform.system()
if(sysstr =="Windows"):
print ("Call Windows tasks")
elif(sysstr == "Linux"):
print ("Call Linux tasks")
else:
print ("Other System tasks") UsePlatform()

python 判断操作系统类型的更多相关文章

  1. Python判断操作系统类型

    代码: import platform def TestPlatform(): print ("----------Operation System--------------------- ...

  2. Java 判断操作系统类型(适用于各种操作系统)

    Java 判断操作系统类型(适用于各种操作系统) 最近一段时间写一个授权的程序,需要获取很多信息来保证程序不能随意复制使用,必须经过授权才可以. 为了限制用户使用的操作系统,必须有统一的方法来获取才可 ...

  3. python实例[判断操作系统类型]

    参考文献:http://bbs.chinaunix.net/thread-1848086-1-1.html 经常地我们需要编写跨平台的脚本,但是由于不同的平台的差异性,我们不得不获得当前所工作的平台( ...

  4. 深入C#判断操作系统类型的总结详解(转载)

    Windows操作系统的版本号一览 操作系统  PlatformID  主版本号  副版本号  Windows95  1  4  0  Windows98  1  4  10  WindowsMe   ...

  5. C#判断操作系统类型汇总

    Windows操作系统的版本号一览 操作系统 PlatformID 主版本号 副版本号 Windows95 1 4 0 Windows98 1 4 10 WindowsMe 1 4 90 Window ...

  6. C#判断操作系统类型

    操作系统  PlatformID  主版本号  副版本号  Windows95  1  4  0  Windows98  1  4  10  WindowsMe  1  4  90  WindowsN ...

  7. python判断字符串类型

    s为字符串 s.isalnum() 所有字符都是数字或者字母,为真返回 Ture,否则返回 False.(重点,这是字母数字一起判断的!!) s.isalpha() 所有字符都是字母,为真返回 Tur ...

  8. python判断操作系统

    https://www.crifan.com/python_get_current_system_os_type_and_version_info/ 参考:https://stackoverflow. ...

  9. python 判断操作系统以及操作系统版本号

    >>> import platform >>> platform.platform() 'Darwin-17.7.0-x86_64-i386-64bit' > ...

随机推荐

  1. 仿UC天气下拉和微信下拉眼睛头部淡入淡出--第三方开源--PullLayout

    Android-PullLayout是github上的一个第三方开源项目,该项目主页是:https://github.com/BlueMor/Android-PullLayout 原作者项目意图实现类 ...

  2. PAT 字符串-02 删除字符串中的子串

    /* 2 *PAT 字符串-02 删除字符串中的子串 3 *2015-08-09 4 作者:flx413 5 */ #include<stdio.h> #include<string ...

  3. Visual Studio

    1.必备神器http://www.cnblogs.com/stoneniqiu/p/3488546.html 2.常用快捷键http://www.cnblogs.com/TankXiao/p/3468 ...

  4. 关于WP8 微信分享的补充说明

    1.根据微信官方Demo完成相应功能. 2.在分享完后,从微信回来,需要进行 快速恢复. 3.在快速恢复中加入 RootFrame.Navigating += HandlerFotResetNavig ...

  5. WebAPi性能

    提高WebAPi性能   前言 WebAPi作为接口请求的一种服务,当我们请求该服务时我们目标是需要快速获取该服务的数据响应,这种情况在大型项目中尤为常见,此时迫切需要提高WebAPi的响应机制,当然 ...

  6. what are Datatypes in SQLite supporting android

    As said at Datatypes In SQLite Version 3: Datatypes In SQLite Version 3 Most SQL database engines (e ...

  7. js eval()执行传参函数的写法

    .cs public class Message<T> { // 数据总数 public int? Total { get; set; } // 关键数据 public List<T ...

  8. 循序渐进Java Socket网络编程(多客户端、信息共享、文件传输)

    目录[-] 一.TCP/IP协议 二.TCP与UDP 三.Socket是什么 四.Java中的Socket 五.基本的Client/Server程序 六.多客户端连接服务器 七.信息共享 八.文件传输 ...

  9. linux 删除某种规则命名的文件

    由于android开发需要删除以IMG_开头命名的图片文件,因此用到此命令 命令格式: rm IMG_*

  10. QQ炫舞官网选项卡效果

    这篇博文里需要注意的是当点击事件发生的时候,需要用循环,重置标题的classname和标题底部都设置成隐藏,当点击的时候在加上标题的active属性和显示属性 代码地址:https://github. ...