python判断平台

时间:2022-06-07 16:32:20

网上找到的判断平台的方法,特此记录

# -*- coding: utf-8 -*-
import platform osName = platform.system()
if(osName == 'Windows'):
import windowsEngine as engine
elif(osName == 'Linux'):
import linuxEngine as engine
elif(osName == 'Darwin'):
import macEngine as engine if __name__ == "__main__":
print(platform.system())