Documentation of open()[1] says:
Other common values ... and 'a' for appending (which on some Unix
systems, means that all writes append to the end of the file
regardless of the current seek position).
On my system (Linux 5.4), writes to a file opened as 'a+' go at the end.
[1] https://docs.python.org/3/library/functions.html#open
@filename: name of the file
@entry: data to write to the file
"""
@filename: name of the file
@entry: data to write to the file
"""
- data = open(filename, "a+")
+ data = open(filename, "r+")
for line in data:
if line == entry:
break
for line in data:
if line == entry:
break