|
1 | 1 | # Script Name : osinfo.py
|
2 | 2 | # Author : Craig Richards
|
3 | 3 | # Created : 5th April 2012
|
4 |
| -# Last Modified : |
| 4 | +# Last Modified : 22nd February 2016 |
5 | 5 | # Version : 1.0
|
6 | 6 |
|
7 |
| -# Modifications : |
| 7 | +# Modifications : Changed the list to a dictionary. Although the order is lost, the info is with its label. |
8 | 8 |
|
9 | 9 | # Description : Displays some information about the OS you are running this script on
|
10 | 10 |
|
11 | 11 | import platform
|
12 | 12 |
|
13 |
| -profile = [ |
14 |
| -platform.architecture(), |
15 |
| -platform.dist(), |
16 |
| -platform.libc_ver(), |
17 |
| -platform.mac_ver(), |
18 |
| -platform.machine(), |
19 |
| -platform.node(), |
20 |
| -platform.platform(), |
21 |
| -platform.processor(), |
22 |
| -platform.python_build(), |
23 |
| -platform.python_compiler(), |
24 |
| -platform.python_version(), |
25 |
| -platform.release(), |
26 |
| -platform.system(), |
27 |
| -platform.uname(), |
28 |
| -platform.version(), |
29 |
| -] |
30 |
| -for i, item in enumerate(profile, 1): |
31 |
| - print '#',i,' ',item |
| 13 | +profile = { |
| 14 | +'Architecture: ': platform.architecture(), |
| 15 | +'Linux Distribution: ': platform.linux_distribution(), |
| 16 | +'mac_ver: ': platform.mac_ver(), |
| 17 | +'machine: ': platform.machine(), |
| 18 | +'node: ': platform.node(), |
| 19 | +'platform: ': platform.platform(), |
| 20 | +'processor: ': platform.processor(), |
| 21 | +'python build: ': platform.python_build(), |
| 22 | +'python compiler: ': platform.python_compiler(), |
| 23 | +'python version: ': platform.python_version(), |
| 24 | +'release: ': platform.release(), |
| 25 | +'system: ': platform.system(), |
| 26 | +'uname: ': platform.uname(), |
| 27 | +'version: ': platform.version(), |
| 28 | +} |
| 29 | + |
| 30 | +for key in profile: |
| 31 | + print(key + str(profile[key])) |
0 commit comments