Skip to content

Commit da10311

Browse files
committed
Update osinfo.py
Replaced the list with a dictionary. The order is lost ( because of the dictionary) but the info is displayed better in my opinion.
1 parent 29f7638 commit da10311

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

osinfo.py

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# Script Name : osinfo.py
22
# Author : Craig Richards
33
# Created : 5th April 2012
4-
# Last Modified :
4+
# Last Modified : 22nd February 2016
55
# Version : 1.0
66

7-
# Modifications :
7+
# Modifications : Changed the list to a dictionary. Although the order is lost, the info is with its label.
88

99
# Description : Displays some information about the OS you are running this script on
1010

1111
import platform
1212

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

Comments
 (0)