Answers for "check which os in python"

2

python check is os is windows

from sys import platform
if platform == "linux" or platform == "linux2":
    # linux
elif platform == "darwin":
    # OS X
elif platform == "win32":
    # Windows...
Posted by: Guest on June-18-2020
1

python check operating system

from sys import platform
if platform == "linux" or platform == "linux2":
    # linux
elif platform == "darwin":
    # OS X
elif platform == "win32":
    # Windows...
Posted by: Guest on August-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language