-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversions.py
66 lines (53 loc) · 1.94 KB
/
versions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import platform
import socket
import uuid
import re
import logging
import wmi
import sklearn
import numpy
import pandas
import matplotlib
import seaborn
import psutil
import scikitplot
import xlsxwriter
def print_versions():
print('scikit-learn v{},'.format(sklearn.__version__))
print('NumPy v{},'.format(numpy.__version__))
print('Pandas v{},'.format(pandas.__version__))
print('Matplotlib v{},'.format(matplotlib.__version__))
print('Seaborn v{},'.format(seaborn.__version__))
print('Psutil v{},'.format(psutil.__version__))
print('Scikitplot, v{}'.format(scikitplot.__version__))
def print_system_info():
info = {'platform': platform.system(),
'platform-release': platform.release(),
'platform-version': platform.version(),
'architecture': platform.machine(),
'hostname': socket.gethostname(),
'ip-address': socket.gethostbyname(socket.gethostname()),
'mac-address': ':'.join(re.findall('..', '%012x' % uuid.getnode())),
'processor': platform.processor(),
'ram': str(round(psutil.virtual_memory().total / (1024.0 ** 3))) + " GB"}
computer = wmi.WMI()
os_info = computer.Win32_OperatingSystem()[0]
os_name = platform.system() + ' ' + platform.release()
os_version = ' '.join([os_info.Version, os_info.BuildNumber])
proc_info = computer.Win32_Processor()[0]
gpu_info = computer.Win32_VideoController()[0]
system_ram = float(os_info.TotalVisibleMemorySize) / 1048576 # KB to GB
print('OS Name: {0}'.format(os_name))
print('OS Version: {0}'.format(os_version))
print('Architecture: {0}'.format(platform.machine()))
print('CPU: {0}'.format(proc_info.Name))
print('RAM: {0} GB'.format(round(system_ram)))
print('Graphics Card: {0}'.format(gpu_info.Name))
print(info)
print_versions()
print_system_info()
p = psutil.Process()
info = p.memory_percent()
print(info)
print('The end.')
quit()