Commit ce8b9327 by BellCodeEditor

save project

parent dbc1774f
Showing with 10 additions and 3 deletions
with open(r'c:\cm\desketop\dook.txt','r',encoding='utf-8') as file: with open(r'c:\cm\desketop\dook.txt','r',encoding='utf-8') as file:
for data in file1: for data in file1:
if'小强:10本'in data: if'小强:10本'in data:
pnnt('强存在文件中') pnnt(:10','小强:12')
if'小兰:12'in data: if'小兰:12'in data:
pnnt('兰存在文件中') pnnt('小兰:12','小兰:14')
\ No newline at end of file
with open(r'c:\cm\desketop\dook.txt','r',encoding='utf-8') as file1:
file1.wirte(new_data)
with open(r'c:\cm\desketop\dook.txt','r',encoding='utf-8') as file1:
a=file1.read()
print(a)
\ 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