Commit dc7a83c3 by BellCodeEditor

save project

parent 89884609
Showing with 7 additions and 2 deletions
...@@ -6,7 +6,12 @@ ...@@ -6,7 +6,12 @@
#file1.write('我嘞个骚缸:13本\n') #file1.write('我嘞个骚缸:13本\n')
#a=file1.read() #a=file1.read()
#print(a) #print(a)
new_data=''
with open(r'C:\Users\David\Desktop\捐赠明细.txt','r',encoding='utf-8')as file1: with open(r'C:\Users\David\Desktop\捐赠明细.txt','r',encoding='utf-8')as file1:
for data in file1: for data in file1:
if'我嘞个骚缸:13本'in data: if'我嘞个骚缸:13本'in data:
print('数据在文件中') data=data.replace('我嘞个骚缸:13本''我嘞个骚缸:7本')
\ No newline at end of file new_data +=data
with open(r'C:\Users\David\Desktop\捐赠明细.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