Posted By

magicrebirth on 12/22/09


python platform

Versions (?)

Python: PLATFORM module

 / Published in: Python

  1. ## The platform module provides a portable interface to information about the platform on which the program is being executed. ## The following examples illustrate some of the most common uses of the platform module.
  3. ## The platform.architecture() function returns the (bits, linkage) tuple that specifies the number of bits for the system word size and linkage information about the Python executable:
  5. >>>print platform.architecture()
  6. ('32bit', '')
  8. ##The platform.python_version() function returns the version of the Python executable for compatibility purposes:
  10. >>>print platform.python_version()
  11. 2.4.2
  13. ## The platform.uname() function returns a tuple in the form of (system, node, release, version, machine, processor). System refers to which OS is currently running, node refers to the host name of the machine, release refers to the major release of the OS, version refers to a string representing OS release information, and machine and processor refer to the hardware platform information.
  15. >>>print platform.uname()
  16. ('Linux', 'bwd-linux', '2.6.16-20-smp',
  17. '#1 SMP Mon Apr 10 04:51:13 UTC 2006',
  18. 'i686', 'i686')

Report this snippet  

You need to login to post a comment.