提交report的文件读写关键字和文件
This commit is contained in:
@@ -80,6 +80,32 @@ class GetTime():
|
||||
return "ture"
|
||||
else:
|
||||
return "false"
|
||||
#文件写入
|
||||
def lyf_list_write(self,path,a):
|
||||
if type(a) == int:
|
||||
a=str(a)
|
||||
else:
|
||||
a=a
|
||||
with open(path, 'a+') as f:
|
||||
f.write("\n"+a)
|
||||
|
||||
#文件读取
|
||||
def lyf_list_read(self,path):
|
||||
with open(path, 'r') as f:
|
||||
b=f.read()
|
||||
# print(b)
|
||||
d = b.split()
|
||||
print(d)
|
||||
list1 = []
|
||||
for i in d:
|
||||
if type(i)==str:
|
||||
z = int(i)
|
||||
list1.append(z)
|
||||
else:
|
||||
i = i
|
||||
list1.append(i)
|
||||
print(list1)
|
||||
return list1
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user