Commit 95a11225 by BellCodeEditor

save project

parent 7a6ca44f
Showing with 13 additions and 5 deletions
......@@ -13,7 +13,15 @@
# with open(r'C:\Users\Windows 7\Desktop\a.txt','r',encoding='utf-8')as a:
# b=a.read()
# print(b)
a=open(r'C:\Users\Windows 7\Desktop\a.txt','r',encoding='utf-8')
for i in a:
if'小兰:12本'in i:
print("在")
\ No newline at end of file
# a=open(r'C:\Users\Windows 7\Desktop\a.txt','r',encoding='utf-8')
# for i in a:
# if'小兰:12本'in i:
# print("在")
b=""
with open(r'C:\Users\Windows 7\Desktop\a.txt','r',encoding='utf-8')as a:
for i in a:
if'小兰:12本'in i:
i=i.replace('小兰:12本','小兰:13本')
b+=i
with open(r'C:\Users\Windows 7\Desktop\a.txt','w',encoding='utf-8')as a:
a.write(b)
\ 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