Commit ab7a12ac by BellCodeEditor

save project

parent 8da0dd59
Showing with 12 additions and 4 deletions
......@@ -5,10 +5,18 @@
# with open(r"C:\Users\周子轩\Desktop\test.txt","r",encoding="utf-8") as file:
# a=file.read()
# print(a)
with open() as file:
new_date=''
with open(r"C:\Users\周子轩\Desktop\test.txt","r",encoding="utf-8") as file:
a=file.read()
for i in a:
if i=="小强:20本":
print("数据在文件中")
if i=="小兰:12本":
if i=="小强:15本":
print("数据在文件中")
# if i=="小兰:12本":
# print("数据在文件中")
new_date=repiace
for i in a:
if i=="小强:20本":
i.repiace("小强:20本","小强:15本")
new_date+=i
with open(w"C:\Users\周子轩\Desktop\test.txt","r",encoding="utf-8") as filel:
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