How to use 'python check os type' in Python

Every line of 'python check os type' 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')
198@staticmethod
199def get_os_family():
200 """
201 Return values:
202 redhat, debian, suse ... and others
203
204 In case cannot detect raises exception( from self.get_operating_system_type() ).
205 """
206 if(OSCheck._dist[0] == 'Windows'):
207 os_family = OSConst.WIN_OS_FAMILY_COLLECTION[0]['name']
208 else:
209 os_family = OSCheck.get_os_type()
210 for os_family_item in OSConst.OS_FAMILY_COLLECTION:
211 if os_family in os_family_item['os_list']:
212 os_family = os_family_item['name']
213 break
214
215 return os_family.lower()

Related snippets