Python gets operating system platform, version, and architecture

Source: Internet
Author: User

The Platform module provides information about the underlying system platform

System architecture

32-bit or 64-bit

>>>ImportPlatform>>>platform.architecture () ('64bit','ELF')#python 3.3.2+ bits on debian Jessie('32bit','WindowsPE')#python 3.3.2 bits on Windows 8.1('64bit','WindowsPE')#python 3.3.2 bits on Wndows 8.1('64bit',"')#python 3.4.1 bits on Mac OS X 10.9.4

Elf and windowsPE are executable file formats

Operating system
Linux,mac or Windows

>>>Platform.system ()'Linux'#python 3.3.2+ bits on debian Jessie'Windows'#python 3.3.2 bits on Windows 8.1'Windows'#python 3.3.2 bits on Windows 8.1'Darwin'#python 3.4.1 bits on Mac OS X 10.9.4#orImportSYS>>>Sys.platform'Win32'

System version

>>>platform.version ()'#1 SMP Debian 3.10.11-1 (2013-09-10)'#python 3.3.2+64 bits on debian Jessie'6.2.9200'#python 3.3.2 bits on Windows 8.1'6.2.9200'#python 3.3.2 bits on Windows 8.1'Darwin Kernel Version 13.3.0:tue June 3 21:27:35 PDT; root:xnu-2422.110.17~1/release_x86_64'#python 3.4.1 bits on Mac OS X 10.9.4

CPU Platform

>>> platform.dist ('debian','jessie/sid'  ")#  python 3.3.2+ bits on debian Jessie

Node name
Which is the machine name.

>>> Platform.node ()'work'#  python 3.3.2+-bits on Debian Jessie'work-xxx'#  python 3.3.2 on Windows 8.1 bits

System Information

>>>platform.uname () Uname_result (System='Linux', node=' Work', release='3.10-3-amd64', version='#1 SMP Debian 3.10.11-1 (2013-09-10)', machine='x86_64', processor="')#python 3.3.2+64 bits on debian JessieUname_result (System='Windows', node='work-xxx', release='8', version='6.2.9200', machine='AMD64', processor='Intel64 Family 6 Model stepping 9,Genuineintel') # python 3.3.2 bits on Windows 8.1Uname_result (System='Darwin', node='MBA', release='13.3.0', version='Darwin Kernel Version 13.3.0:tue June 3 21:27:35 PDT; root:xnu-2422.110.17~1/release_x86_64', machine='x86_64', processor='i386')#python 3.4.1 bits on Mac OS X 10.9.4

Python version

>>> Platform.python_verison ()'3.3.2+'#  python 3.3.2+ 64 Bits on Debian Jessie"3.3.3"#  python 3.3.2

 

Python gets operating system platform, version, and architecture

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.