Checks what os is running
Project description
Checks what os is running
Tested against Windows 10/Android/Linux / Python 3.11 / Anaconda
pip install osversionchecker
The main focus is differentiating classic Linux / Android
Determines the operating system by analyzing various system characteristics
and assigns points based on detected features. The OS with the highest points
is considered the active operating system.
Returns:
tuple: A dictionary with the points for each operating system and the
name of the detected active operating system.
The function checks the following:
- If the sys.executable path indicates a Windows system.
- If the sys.executable path starts with '/data/data/' indicating an Android system.
- The count of backslashes and slashes in the environment variables string.
- The presence of certain files or directories that are specific to Windows or Android.
- The output of certain shell commands that indicate an Android system.
- The content of the uname command output to check for Linux, Darwin (macOS), or Android.
- The platform information from the platform module to check for Linux, Darwin (macOS), or Android.
- The sys.platform value to check for Linux, Darwin (macOS), Windows, or Android.
- The sys.version string to check for Linux, Darwin (macOS), or Windows.
from osversionchecker import check_os
os_system_points, active_os_system = check_os()
print(active_os_system)
print(os_system_points)
windows
{'windows': 5, 'linux': 0, 'darwin': 0, 'android': 0}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
osversionchecker-0.10.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for osversionchecker-0.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4eda7e1a4e8642defb4db0dca8f25c2415d52a5ed74bc7fabc1d37fccdc0df3 |
|
MD5 | 31c26b498264f5d4e3d7de2db5161d87 |
|
BLAKE2b-256 | 349bd378068e4b1c43a62f0fdac4001d8b2a062a7a2e27bf5301c51e31003ac6 |