#!/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. Silverlight中嵌套html、swf、pdf

    1.MainPage.xaml <UserControl x:Class="SilverlightClient.MainPage" xmlns="http://sc ...

  2. centos 减少tty数量的方法

    在linux中,包括本文介绍的centos系统中,tty系统默认是给出7个,前六个是terminal,一个用于X. 在centos5.x中减少tty数量,通过修改/etc/inittab来实现. [r ...

  3. js 鼠标事件的抓取代码

    js 鼠标事件的抓取代码,分享给大家. 1.通过ele.setCapture();设置鼠标事件的抓取. 2,应用可以通过单.双击文字来获取时间. <html> <head> & ...

  4. Delphi XE5教程4:程序和单元概述

    内容源自Delphi XE5 UPDATE 2官方帮助<Delphi Reference>,本人水平有限,欢迎各位高人修正相关错误!也欢迎各位加入到Delphi学习资料汉化中来,有兴趣者可 ...

  5. windows创建桌面快捷方式的VBA脚本

    Dim wShell, oShortcut    'Dim strDesktop$ ' 为了与VBS兼容,    Dim strDesktop    ' 这里改写一下,测试通过...    Set w ...

  6. 使用Qpython3制作老版天翼飞TP路由器拨号脚本

    #幻境拨号python版 #by 1414641776 account='xxxxxx@96301' password='xxxxx' # 路由器脚本 def sendToRoute(account, ...

  7. 查看表空间信息SQL集合

    1.查看表空间的名称及大小 SELECT t.tablespace_name as "表空间名", )), ) AS "所占物理空间M" FROM dba_ta ...

  8. gtest功能测试一

    一.前言 这篇文章主要总结gtest中的所有断言相关的宏. gtest中,断言的宏可以理解为分为两类,一类是ASSERT系列,一类是EXPECT系列.一个直观的解释就是: 1. ASSERT_* 系列 ...

  9. mysql中实现oracle中的rowid功能

    mysql中没有函数实现,只能自己手动添加变量递增  := 就是赋值,只看红色字体就行 select @rownum:=@rownum+1,img.img_path,sku.sku_name from ...

  10. asp.net中XmlDocument解析出现出错,处理特殊字符

    xml结构会解析一些特殊字符,特别是& <  所以我们需要把结构放在CDATA中处理,CDATA里面的内容在XmlDocument 解析时会自动忽略掉,不会解析里面的内容:因此,我这里就 ...