3 examples of 'python check os' in Python

Every line of 'python check os' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
55def OSCheck(self):
56 if sys.platform == 'win32':
57 cprint("[-] Windows 32-Bit Detected! Gloom Framework is Unix/Linux Based!", 'red')
58
59 if sys.platform == 'win64':
60 cprint("[-] Windows 64-Bit Detected! Gloom Framework is Unix/Linux Based!", 'red')
61
62 else:
63 cprint("[!] Unix/Linux Kernel Detected!", 'green')
282def check_python_version():
283 if sys.version_info < (3, 5):
284 stderr.write("DistAlgo requires Python version 3.5 or newer.\n")
285 return False
286 else:
287 return True
14def is_python(path):
15 '''Whether the given file is Python.'''
16 if path is not None:
17 return run(['file', path]).find('Python') >= 0
18 else:
19 return False

Related snippets