Commit 3bf5915b by BellCodeEditor

save project

parent 8774b707
Showing with 5 additions and 3 deletions
...@@ -9,9 +9,11 @@ with open(r"C:\Users\bellcode\Desktop\aqw.txt","r",encoding="utf-8") as fell: ...@@ -9,9 +9,11 @@ with open(r"C:\Users\bellcode\Desktop\aqw.txt","r",encoding="utf-8") as fell:
for data in fell: for data in fell:
if '小强:10本' in data: if '小强:10本' in data:
data.replace('小强:10本','小强:11本') data.replace('小强:10本','小强:11本')
print('数据在文件中')
if '小兰:12本' in data: if '小兰:12本' in data:
print('数据在文件中') print('数据在文件中')
new_fecc+=data new_fecc+=data
with open(r"C:\Users\bellcode\Desktop\aqw.txt","w",encoding="utf-8") as fell: with open(r"C:\Users\bellcode\Desktop\aqw.txt","w",encoding="utf-8") as fell:
fell.write(new_fecc) fell.write(new_fecc)
\ No newline at end of file with open(r"C:\Users\bellcode\Desktop\aqw.txt","r",encoding="utf-8") as fell:
abcdefghijklmnopqrstuvwxyz=fell.read()
print(abcdefghijklmnopqrstuvwxyz)
\ 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