I am trying to make a plugin for a video-game, and all inputs the program takes are taken from a log-file provided by the server. (the plugin is running in windows)
Sometimes, the server appends the log-file too quickly and my script isn't able to keep up. I do have a separate thread continiously reading the file. I've tried several solutions like:
def get_line():
last_line = ""
with open(mypath1 + "log.log", "r") as f:
for line in f:
pass
last_line = line[:-1]
return last_line
But it isn't quite quick enough. I am in no way a professional programmer, just learning as i go. Any suggestions would be much appreciated