tail

gmx.tail(fname, n)[source]

Read the last n lines from a file.

Parameters:
  • fname (str or bytes or os.PathLike) – Name of the input file.

  • n (int) – The number of lines to read from the end of the input file.

Returns:

lines (list) – List containing the last n lines of the input file. Each list item represents one line of the file.