티스토리 뷰

공부

[Python] Get OS

승가비 2020. 2. 21. 23:23
728x90
>>> import os
>>> os.name
'posix'
>>> import platform
>>> platform.system()
'Linux'
>>> platform.release()
'2.6.22-15-generic'


from sys import platform as _platform

if _platform == "linux" or _platform == "linux2":
    # linux
elif _platform == "darwin":
    # MAC OS X
elif _platform == "win32":
    # Windows
elif _platform == "win64":
    # Windows 64-bit

https://stackoverflow.com/questions/1854/what-os-am-i-running-on

728x90

'공부' 카테고리의 다른 글

[Oracle] to_date & to_char  (0) 2020.02.21
[JS] HTML5 pattern=  (0) 2020.02.21
[JS] jQuery datepicker  (0) 2020.02.21
[Java] JSTL foreach  (0) 2020.02.21
[Java] 1.0E-4 to 0.0001  (0) 2020.02.21
댓글