Commit 1d94fd39 by BellCodeEditor

save project

parent 9b85ab01
Showing with 4 additions and 5 deletions
...@@ -5,10 +5,10 @@ file.write("小丽:11本",'\n') ...@@ -5,10 +5,10 @@ file.write("小丽:11本",'\n')
file.write("李文:9本",'\n') file.write("李文:9本",'\n')
file.write("张伟:16本") file.write("张伟:16本")
file.close() file.close()
new_data=" "
with open(r"C:\Users\Administrator\Desktop\新建 Microsoft Word 文档.doc ",'r',encoding='utf-8') as file: with open(r"C:\Users\Administrator\Desktop\新建 Microsoft Word 文档.doc ",'r',encoding='utf-8') as file:
for data in file: for data in file:
if "小兰:12本" in data: if "小兰:12本" in data:
print("yes") data=data.replace("小兰:12本","小兰:14本")
else: new_data +=data
print("no")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment