From 1f863d35128c008fb65abbab3d60934c4ecb1c0a Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sat, 19 Jun 2021 19:06:35 +0800 Subject: [PATCH] auto save --- diy.py | 15 +++++++++++++++ iw.py | 0 2 files changed, 15 insertions(+) create mode 100644 diy.py create mode 100644 iw.py diff --git a/diy.py b/diy.py new file mode 100644 index 0000000..d9a151c --- /dev/null +++ b/diy.py @@ -0,0 +1,15 @@ +# 写入同学们的捐赠明细:'小兰:12本'、'小丽:11本'、'李文:9本'、'张伟:16 +#file1 = open(r'C:\Users\Administrator\Desktop\book.txt','w',encoding = 'utf-8') +#file1.write('iusdyfhcsiua') +#file1.write('牛马') +#file1.close() + +#with open(r'C:\Users\Administrator\Desktop\book1.txt','w',encoding = 'utf-8') as file: + #file.write('小强,10本\n') + #file.write('打骂毛锦淇'',250本\n') + + +with open(r'C:\Users\Administrator\Desktop\book1.txt','r',encoding = 'utf-8') as file: + for data in file: + if '12345' in data: + print("文件中有") \ No newline at end of file diff --git a/iw.py b/iw.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/iw.py -- libgit2 0.25.0