python每日学习01

作者: FastgoStone | 来源:发表于2018-01-20 20:39 被阅读1次

platform库,跨平台时可以判断当前系统

import platform
def testPlatfrom():
    platform_system = platform.system()
    print(platform_system)
    #跨平台可以用
    OS_MAC = (platform_system == 'Darwin')
    OS_WIN = (platform_system == 'Windows')
    OS_LINUX = (platform_system == 'Linux')

if __name__ == '__main__':
     testPlatfrom()

相关文章

  • python每日学习01

    platform库,跨平台时可以判断当前系统

  • Python学习笔记-Day01

    Python学习笔记 Day_01 学习教程 “人生苦短,我用Python!“ 网络上python学习的教程非常多...

  • 第一篇:开搞supervisors!

    python每日一记:学习使用supervisor 介绍 Supervisor 是基于 Python 的进程管理工...

  • Python 快速教程(补充篇)

    注:采转归档,自己学习查询使用 Python 快速教程(补充篇01): Python的序列的方法Python 快速...

  • Python 快速教程(网络)

    注:采转归档,自己学习查询使用 Python 快速教程(网络01):原始Python服务器Python 快速教程(...

  • Python_安装

    Python学习01安装 在Mac上安装Python: 第一种方法:直接去Python官网下载Python安装程序...

  • python学习-01

    1、使用while循环输入 123456 8910。 实例:n = 0 while n < 11: if...

  • Python学习01

    第一天补齐Python学习内容 Python是著名的“龟叔”Guido van Rossum在1989年圣诞节期间...

  • python学习_01

    python的数字类型、字符串、索引、切片讲解 python的数据类型 【重点学习】字符串【表示、索引、切片、内置...

  • Python 学习 -01

    总结学习了一下Python 函数式编程. 对于Python 的所有函数, 有以下特点: 在运行时创建 在数据结构中...

网友评论

    本文标题:python每日学习01

    本文链接:https://www.haomeiwen.com/subject/bftxaxtx.html