
- Users windows vs mac vs linux portable#
- Users windows vs mac vs linux pro#
- Users windows vs mac vs linux free#
Print("sysconfig.get_platform() ", sysconfig.get_platform()) Print("platform.system() ", platform.system()) To compare with your system, simply run this script (and please append results here if missing :) from _future_ import print_function
Users windows vs mac vs linux free#
I started a bit more systematic listing of what values you can expect using the various modules (feel free to edit and add your system): Linux (64bit) + WSL x86_64 aarch64
Users windows vs mac vs linux portable#
Pro: Best portable way for Windows, OSX and Linux.Ĭon: Python folks must keep normalization heuristic up to date. How this works ( source): Internally it will eventually call internal OS APIs, get OS version-specific name like 'win32' or 'win16' or 'linux1' and then normalize to more generic names like 'Windows' or 'Linux' or 'Darwin' by applying several heuristics.


'Windows' # for Linux it prints 'Linux', Mac it prints `'Darwin' How this works ( source): Internally it checks if python has OS-specific modules called posix or nt.Ĭon: no differentiation between Linux or OSX.

'nt' # for Linux and Mac it prints 'posix' See here for various OS-specific values.Ĭon: OS version dependent, so best not to use directly. How this works ( source): Internally it calls OS APIs to get name of the OS as defined by OS. 'win32' # could be 'linux', 'linux2, 'darwin', 'freebsd8' etc
Users windows vs mac vs linux pro#
There are 3 ways to get OS in Python, each with its own pro and cons: It returns Windows, Linux or Darwin (for OSX).
