1. 首页
  2. 数据库
  3. 其它
  4. Python判断操作系统类型代码分享

Python判断操作系统类型代码分享

上传者: 2021-01-08 12:15:18上传 PDF文件 32.41KB 热度 8次
经常地我们需要编写跨平台的脚本,但是由于不同的平台的差异性,我们不得不获得当前所工作的平台(操作系统类型)。 代码如下: 复制代码 代码如下: 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
下载地址
用户评论