Исправление HighMan, 02.05.23 14:42 (текущая версия) :
with open('/sys/block/sda/size') as f: size = int(f.readline()) * 512
Исправление HighMan, 02.05.23 14:41:
with open('/sys/block/sda/size') as f: size = f.readline()
Исходная версия HighMan, 02.05.23 14:41:
''' with open(‘/sys/block/sda/size’) as f: size = f.readline() '''