chicagorot.blogg.se

Users windows vs mac vs linux
Users windows vs mac vs linux






  1. Users windows vs mac vs linux portable#
  2. Users windows vs mac vs linux pro#
  3. 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

  • I don't have a Mac nor a true 32bit system and was not motivated to do it online.
  • anaconda on windows is same as official python windows installer.
  • there is also _platform() which is identical to `sysconfig.get_platform.
  • Platform.system() CYGWIN_NT-10.0 CYGWIN_NT-10.0-WOW Platform.architecture() ('64bit', 'WindowsPE') ('32bit', 'WindowsPE') Platform.architecture() ('64bit', 'WindowsPE') ('64bit', 'WindowsPE') (with 32bit column running in the 32bit subsystem) official python installer 64bit 32bit
  • same output on Windows Subsystem for Linux (tried with ubuntu 18.04 LTS), except platform.architecture() = ('64bit', 'ELF').
  • on python2 sys.platform is suffixed by kernel version, e.g.
  • tried with archlinux and mint, got same results.
  • Sysconfig.get_platform() linux-x86_64 linux-aarch64

    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

  • If you want to get raw OS name as supplied by OS itself then use sys.platform.
  • If you want to make OS-specific calls but via built-in Python modules posix or nt then use os.name.
  • If you want to check if OS is Windows or Linux or OSX then the most reliable way is platform.system().
  • 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.

    users windows vs mac vs linux users windows vs mac vs linux

    '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.

    users windows vs mac vs linux

    '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).








    Users windows vs mac vs linux