Commit a741c765 by BellCodeEditor

save project

parent b08c9642
Showing with 5 additions and 1 deletions
with open(r'C:\Users\22747\Desktop\www.txt,"r",encoding="utf-8")as a:
b=a.readlines()
print(a)
\ No newline at end of file
...@@ -6,7 +6,7 @@ a.write('小丽:11本\n') ...@@ -6,7 +6,7 @@ a.write('小丽:11本\n')
a.write('李文:9本\n') a.write('李文:9本\n')
a.write("张伟:16本\n") a.write("张伟:16本\n")
a.close() a.close()
with open(r"C:\Users\22747\Desktop\qqtxt","r",encoding="utf-8")as a: with open(r"C:\Users\22747\Desktop\qqtxt"c:\Users\22747\Desktop\www.txt
for data in a: for data in a:
if"小兰:12本"in data: if"小兰:12本"in data:
data=data.replace("小兰:12本","小兰:11本") data=data.replace("小兰:12本","小兰:11本")
......
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