Commit e9202dfe by BellCodeEditor

save project

parent efcb174a
Showing with 8 additions and 3 deletions
...@@ -19,7 +19,11 @@ with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8") a ...@@ -19,7 +19,11 @@ with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8") a
a=file.read() a=file.read()
print(a) print(a)
''' '''
with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8") as file1: with open(r"C:\\Users\\Administrator\\Desktop\\test.txt","r",encoding="utf-8") as filel:
for date in file1: for data in filel:
if '小强:10本' in date: if '小强:10本' in data:
data =data.replace("小强:10本","小强:11本")
print("在里面") print("在里面")
\ 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