Commit 29cf403c by BellCodeEditor

save project

parent ade12cde
Showing with 7 additions and 2 deletions
...@@ -2,7 +2,12 @@ ...@@ -2,7 +2,12 @@
#SB=open(r"C:\Users\Administrator\Desktop\111.txt","w",encoding="utf-8") #SB=open(r"C:\Users\Administrator\Desktop\111.txt","w",encoding="utf-8")
#SB.write('小兰:12本') #SB.write('小兰:12本')
#SB.close() #SB.close()
sb=''
with open(r"C:\Users\Administrator\Desktop\111.txt","r",encoding="utf-8") as SB: with open(r"C:\Users\Administrator\Desktop\111.txt","r",encoding="utf-8") as SB:
for i in SB: for i in SB:
if '小兰:12本' in i: if '小兰:12本' in i:
print("哟") i=i.replace( '小兰:12本', '小兰:10本')
\ No newline at end of file sb+=i
with open(r"C:\Users\Administrator\Desktop\111.txt","w",encoding="utf-8") as SB:
SB.write(sb)
\ 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