python 判断系统类型

python 查看系统类型

# -*- coding: utf-8 -*-
import platform
from logger import logger


def is_platform() -> str:
    type = platform.system()
    if type in ["Windows", "Linux", "Mac"]:
        logger.info("this is {}".format(type))
    else:
        logger.info("others system: {}".format(type))

    return type


if __name__ == '__main__':
    is_platform()
posted @ 2021-09-01 18:35  tt_贝塔  阅读(246)  评论(0编辑  收藏  举报