# mtd0: 00500000 00020000 "boot"
# mtd1: 00500000 00020000 "recovery"
# mtd2: 00140000 00020000 "misc"
# mtd3: 00060000 00020000 "splash"
# mtd4: 0aa00000 00020000 "system"
# mtd5: 05d00000 00020000 "cache"
# mtd6: 0a6a0000 00020000 "userdata"
# mtd7: 01400000 00020000 "cust"
partition = 'boot'
out="""
# mtd0: 00500000 00020000 "boot"
# mtd1: 00500000 00020000 "recovery"
# mtd2: 00140000 00020000 "misc"
# mtd3: 00060000 00020000 "splash"
# mtd4: 0aa00000 00020000 "system"
# mtd5: 05d00000 00020000 "cache"
# mtd6: 0a6a0000 00020000 "userdata"
# mtd7: 01400000 00020000 "cust"
"""
for line in out.splitlines():
if partition in line:
print(line.split()[1][:-1])
break
In [25]:
mtd0
for line in out.splitlines():
if partition in line:
print(line[2:6])
break
import csv
file = open('data.csv', 'r') # Вместо data.csv указываете ваш csv файл
data = csv.reader(file)
inputs = []
for line in data:
inputs.append(line[0].split())
keys = []
values = []
for i in range(len(inputs)):
keys.append(inputs[i][4])
values.append(inputs[i][1])
while True:
x = '"' + input("Введите имя раздела:") + '"'
if x in keys:
for i in range(len(keys)):
if keys[i] == x:
print("Значение: ",values[i])
else:
continue