Commit 58c17029 by BellCodeEditor

save project

parent 96768765
Showing with 15 additions and 6 deletions
......@@ -12,10 +12,19 @@ with open(r'C:\Users\玛酷机器人市南店3号\Desktop\book.txt','r',encoding
for data in filel:
if '小强:10本'in data:
print('xiaoqiangzaijinitaitaimei')
if 'xiaolan:12本'in data:
if '小兰:12本'in data:
print('xiaolandefenbeiwale')
new_data="
new_data=''
with open(r'C:\Users\玛酷机器人市南店3号\Desktop\book.txt','a',encoding='utf-8')as filel:
for data in file 1:
if'小强:10本'in data:
data=
\ No newline at end of file
for data in filel:
if'小强:10本'in data:
data=data.replace('小强:10本','小强:11本')
if'小兰:12本'in data:
data=data.replace('小兰:12本','小兰:14本')
new_data +=data
with open(r'C:\Users\玛酷机器人市南店3号\Desktop\book.txt','a',encoding='utf-8') as filel:
filel.read(new_data)
with open(r'C:\Users\玛酷机器人市南店3号\Desktop\book.txt','a',encoding='utf-8') as filel:
a=filel.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