You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

8 lines
274 B

def save(lst):
try:
stu_text=open(filename,'a',encoding='utf-8')#打开文件,以追加的形式
except:
stu_text=open(filename,'w',encoding='utf-8')#以只写的形式打开文件
for item in lst:
stu_text.write(str(item)+'\n')