实现代码如下:

# 读取配置文件,取其值组成列表
class ReadTxt:
def read_txt(self,path):
li_info = []
with open(path) as f:
li = f.readlines()
for i in li:
a = i.split("=")[1]
b = a.strip("\n")
li_info.append(b)
return li_info

 

posted on 2019-11-28 19:48  badbadboy  阅读(268)  评论(0编辑  收藏  举报