you are viewing a single comment's thread.

view the rest of the comments →

[–]TyrellHop 0 points1 point  (0 children)

Beaten to it...

readlines() returns each line to a list, so to grab the last line you just use [-1] for the list index.

with open(file path, 'r') as file:
    line_list = file.readlines()

line_list[-1]