0

i can write to the file with no issues, but cant read. i have defined the file to append so as not to overwrite data. then i write to it

log_file.writelines(lines)
but the reading wont work??
log_file.readlines(lines)
and thought i could just use
log_file = open('%s' % os.path.join(logfile_path, file), 'a+r')

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by bvdet
0

i can write to the file with no issues, but cant read. i have defined the file to append so as not to overwrite data. then i write to it

log_file.writelines(lines)
but the reading wont work??
log_file.readlines(lines)
and thought i could just use
log_file = open('%s' % os.path.join(logfile_path, file), 'a+r')

Close the log file, then open again for reading.

log_file.close()
log_file = open('%s' % os.path.join(logfile_path, file))
lineList = log_file.readlines()
log_file.close()
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.