通讯录读取
n = input()
dict1 = dict()
with open('info.csv', 'r', encoding='GBK') as f:
for line in f.readlines():
line = line.strip('/n')
ls = list(line.split(','))
ls1 = ls[1:]
dict1[ls[0]] = ls1
if n == 'A':
with open('info.csv', 'r', encoding='GBK') as f:
for line in f.readlines():
line = line.strip('/n')
line = line.replace(',', ' ')
print(line)
elif n == 'D':
print(dict1)
else:
print('ERRO
通讯录读取最先出现在Python成神之路。
共有 0 条评论