What how have you tried to do it?
Post your code and we can see what is your problem
Tony
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852
Ok, another alternative solution:
from __future__ import print_function
import os
PATH = os.curdir
EXTENSIONS = '.TXT','.ME','1ST'
for filename in (inf for inf in os.listdir(PATH)
if inf.upper().endswith(EXTENSIONS)):
with open(filename) as textfile:
try:
print(next(textfile), next(textfile))
print('-'*40)
except StopIteration:
continue
pyTony
pyMod
5,359 posts since Apr 2010
Reputation Points: 782
Solved Threads: 852