def all_a(func):
def spl(file_name):
data = func(file_name)
k = []
for i in data:
m = i.split('\n')
m = m[0]
k.append(m)
return k
return spl
@all_a # all_a(openfile)
def openfile(file_name):
file = open(file_name, 'r')
a = file.readlines()
file.close()
return a
a = openfile('k.txt')
print(a)
b = openfile('l.txt')
print(b)
print(dict(zip(a, b)))
网友评论