Commit 7b1aa137 by BellCodeEditor

save project

parent a8d02629
Showing with 14 additions and 0 deletions
new_sb = ''
with open(r'C:\Users\EDY\Desktop\book.txt', 'r',encoding = 'utf-8') as f:
for sb in f:
if '小强' in sb:
print("sb")
sb = sb.replace('小强:12本','小强:11本')
if '小兰:12本' in sb:
print("250")
sb = sb.replace('2','4')
new_sb += sb
print(new_sb)
with open(r'C:\Users\EDY\Desktop\book.txt', 'w',encoding = 'utf-8') as f:
f.write(new_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