python实现读取配置文件

实现代码如下:

# 读取配置文件,取其值组成列表
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(" ")
li_info.append(b)
return li_info
原文地址:https://www.cnblogs.com/badbadboyyx/p/11953254.html