Commit b646b10a by BellCodeEditor

save project

parent 794ab4a5
Showing with 14 additions and 3 deletions
with open(r'C:\users\CM\Desktoo\book.tst','a'encoding='uef-8') with open(r'C:\users\CM\Desktoo\book.tst','a'encoding='uef-8')as
for date in file1: for date in file1:
if '小强:10\n本'in date if '小强:10\n本'in date
print("小强数据在其中") date= date.replace('小强:10\n本','小强:11\n本')
if '小兰:12\n本'in date if '小兰:12\n本'in date
print("小兰数据在其中") date= date.replace('小兰:12\n本','小兰:14\n本')
new_date+=date
with open(r'C:\users\CM\Desktoo\book.tst','w'encoding='uef-8')as file1:
file1 .white(new_date)
with open(r'C:\users\CM\Desktoo\book.tst','w'encoding='uef-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