Quick actions

cmd+k|ctrl+k

Navigation

Languages

vinhquang5.2

Snippet info

Language

Python

Visibility

public

Author

vinhquang-pyt

Created

2016-10-17T02:33:20Z

Updated

2016-10-17T07:37:46Z

# Ex2
# ---

# Kiểm tra OS của máy đang dùng  xem có là Linux based OS không?

# Hướng dẫn: sử dụng sys module.

# https://docs.python.org/2/library/sys.html


def os():
    import sys
    if sys.platform == 'linux':
        print('This os is %s' % sys.platform)
    else:
        print('This os is not linux')

os()

# result5.2: This os is linux
INFO