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')

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()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.