you can do something like this: (not too elegant way tho)
...
articles = read_articles_from_file()
append_flag = True
for i, article in enumerate(articles): # loop through existing articles
if title == article['title']: # if new title is already exists
articles[i]['content'] = content # update content of that article
append_flag = False # update flag to false
break # break the loop, assumed title is unique
if append_flag: # append new record
articles.append({
"title": title.strip(), # strip out spaces, to ensure str==str comparison for content updates
"content": content
})
...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…