This module is used to access platform-related properties.
Common Properties and methods
Platform Architecture
Platform.machine ()
Returns the platform schema. If it cannot be determined, an empty string is returned.
>>> platform.machine () ' AMD64 ' >>> platform.machine () ' x86_64 '
Network Name (host name)
Platform.node ()
Returns the network name of the computer (may not be fully qualified!) )。 If the value cannot be determined, an empty string is returned.
#windows >>> Platform.node () ' Office ' #linux >>> Platform.node () ' Abcxx '
System version
0 0)
If aliased is true, the function uses aliases from different platforms to report system names that differ from their common names, for example, SunOS will be reported as Solaris. The System_alias () function is used to implement.
Setting terse to true causes the feature to return only the absolute minimum information required to identify the platform.
>>> platform.platform () ' Windows-8.1-6.3.9600-sp0 ' >>> platform.platform (aliased=true) ' Windows-8.1-6.3.9600-sp0 ' >>> platform.platform (aliased=true,terse=true) ' Windows-8.1 ' >>> Platform.platform (aliased=true,terse=false) ' windows-8.1-6.3.9600-sp0 ' #linux >>> platform.platform () ' Linux-2.6.32-642.13.1.el6.x86_64-x86_64-with-centos-6.8-final '
Processor Name
Platform.processor ()
Returns the processor name.
>>> platform.processor () ' Intel64 Family 6 Model Stepping 3, Genuineintel ' #linux >>> Platform.processor () ' x86_64 '
System name
Platform.system ()
Returns the system/operating system name, such as "Linux", "Windows" or "Java". If the value cannot be determined, an empty string is returned.
>>> Platform.system () ' Windows ' #linux >>> platform.system () ' Linux '
Python Learning Platform Module