feat[OS/win4]: сделал эту еб**ую лабу
This commit is contained in:
20
OSs/lab-virt-win/util.py
Normal file
20
OSs/lab-virt-win/util.py
Normal file
@ -0,0 +1,20 @@
|
||||
#/usr/bin/python3
|
||||
# чтобы удобнее было посмотреть разницу
|
||||
|
||||
import re
|
||||
|
||||
with open("report.txt", 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
while len(lines) > 0:
|
||||
for line in lines[1:4]:
|
||||
line = line.strip()
|
||||
m = re.match(r"([\w ]+): (\d+)/(\d+)", line)
|
||||
assert m
|
||||
name = m.group(1)
|
||||
total = int(m.group(2))
|
||||
avail = int(m.group(3))
|
||||
print(f"{name}: {total}/{avail} ({avail/total*100:.2f}%, "
|
||||
f"delta: {total - avail})")
|
||||
print()
|
||||
lines = lines[7:]
|
||||
Reference in New Issue
Block a user