Commit e4bdb2ab by BellCodeEditor

save project

parent 2651d3f2
Showing with 10 additions and 0 deletions
......@@ -8,3 +8,12 @@
with open(r'C:\Users\makcoo\Desktop\text.txt','a',encoding='utf-8')as file1:
file1.write("小强:12\n")
file1.write("李明:15\n")
with open(r'C:\Users\makcoo\Desktop\text.txt','r',encoding='utf-8')as file1:
a = file1.read()
for data in a:
print(data)
if data == "小强:12\n":
print(data)
data.replace("小强:12\n"("李明:15\n"))
with open(r'C:\Users\makcoo\Desktop\text.txt','r',encoding='utf-8')as file1:
file1.write(new_data)
\ 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