find the header then just take the next four lines, the last line will be what you want.
from itertools import islice
with open("words.txt") as f:
for line in f:
if line.rstrip() == "Heading":
print(list(islice(f, 4))[-1])
break
line to be extracted
Or use linecache getting the line four lines after the Heading line:
from linecache import getline
with open("words.txt") as f:
for ind, line in enumerate(f,1):
if line.rstrip() == "Heading":
print(getline(f.name, ind + 4))
break
line to be extracted
If you have multiple lines, don't break.
from linecache import getline
with open("words.txt") as f:
for ind, line in enumerate(f,1):
if line.rstrip() == "Heading":
print(getline(f.name, ind + 4))
line to be extracted
other line to be extracted