From a672bc559a6d5b25ffd25596d652fbf3f0ea0373 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Wed, 27 Jul 2022 12:13:03 +0800 Subject: [PATCH] save project --- diy.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diy.py b/diy.py index ad5ec8c..c856705 100644 --- a/diy.py +++ b/diy.py @@ -5,13 +5,13 @@ file.close() -new_file='小强:12本' +new_file='' with open(r'C:\Users\Administrator\Desktop\book.text','r',encoding='utf-8')as file: #file.write('小强:12本\n李明:15本\n') for i in file: print(i) if '小强:12本' in i: - i=i.replace("小强:12本":"小强:14本") + i=i.replace("小强:12本","小强:14本") new_file+=i print(new_file) -- libgit2 0.25.0