python 判断操作系统类型
#!/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 判断操作系统类型的更多相关文章
- Python判断操作系统类型
代码: import platform def TestPlatform(): print ("----------Operation System--------------------- ...
- Java 判断操作系统类型(适用于各种操作系统)
Java 判断操作系统类型(适用于各种操作系统) 最近一段时间写一个授权的程序,需要获取很多信息来保证程序不能随意复制使用,必须经过授权才可以. 为了限制用户使用的操作系统,必须有统一的方法来获取才可 ...
- python实例[判断操作系统类型]
参考文献:http://bbs.chinaunix.net/thread-1848086-1-1.html 经常地我们需要编写跨平台的脚本,但是由于不同的平台的差异性,我们不得不获得当前所工作的平台( ...
- 深入C#判断操作系统类型的总结详解(转载)
Windows操作系统的版本号一览 操作系统 PlatformID 主版本号 副版本号 Windows95 1 4 0 Windows98 1 4 10 WindowsMe ...
- C#判断操作系统类型汇总
Windows操作系统的版本号一览 操作系统 PlatformID 主版本号 副版本号 Windows95 1 4 0 Windows98 1 4 10 WindowsMe 1 4 90 Window ...
- C#判断操作系统类型
操作系统 PlatformID 主版本号 副版本号 Windows95 1 4 0 Windows98 1 4 10 WindowsMe 1 4 90 WindowsN ...
- python判断字符串类型
s为字符串 s.isalnum() 所有字符都是数字或者字母,为真返回 Ture,否则返回 False.(重点,这是字母数字一起判断的!!) s.isalpha() 所有字符都是字母,为真返回 Tur ...
- python判断操作系统
https://www.crifan.com/python_get_current_system_os_type_and_version_info/ 参考:https://stackoverflow. ...
- python 判断操作系统以及操作系统版本号
>>> import platform >>> platform.platform() 'Darwin-17.7.0-x86_64-i386-64bit' > ...
随机推荐
- Android开发之计算器(一)界面设计
计算器开发主要涉及到LinearLayout布局.EditText.Button的使用.为android入门基础内容. 打开android studio选择创建一个新的工程,应用程序的名称为Calcu ...
- Winform合并多个Excel文件到一个文件中(源文件.xls,实际是.xml)
1.下面两个文件.xls是给的文件,实际上是.xml文件 2.具体的代码 private void btOK_Click(object sender, EventArgs e) { //0.获取路径文 ...
- C# 发邮件类可发送附件
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Ne ...
- 1066. Root of AVL Tree (25)
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child sub ...
- 使用Powershell在Microsoft Azure中创建Virtual Machine
获取虚拟机镜像 PS C:\WINDOWS\system32> Get-AzureVMImage 仅获得虚拟机名 PS C:\WINDOWS\system32> (Get-AzureVMI ...
- 【python】 web开发入门
进入Web开发 现在你完成了Python忍者训练,准备深入Ptyhon的Web开发,但现在的问题是有很多的框架,从中选择最好的框架非常困难,但从初学者的角度出发,Flask基本Web框架将非常适合We ...
- Entity Framework(序)
ADO.NET Entity Framework 是一个对象-关系的映射结构,它提供了ADO.NET的一个抽象,可基于引用的数据库获取对象模型.可以通过Entity Framework 使用不同的变成 ...
- extern "C"——用“C”来规约在C++中用C的方式进行编译和链接
C++中的extern “C”用法详解 extern "C"表明了一种编译规约,其中extern是关键字属性,“C”表征了编译器链接规范.对于extern "C& ...
- easyui页面布局
html: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w ...
- android 中使用回调方法(适用于自定义view传值到activity、adapter传值到activity)
如图所示: 每当listview中有选中的操作时都需要发消息给activity,用来实时改变真实需要支付的剩余金额. 代码暂不公开啦!公司项目!