diff --git a/Save.py b/Save.py new file mode 100644 index 0000000..699bcb0 --- /dev/null +++ b/Save.py @@ -0,0 +1,7 @@ +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')