with open('myfile.txt') as f:
for line in f:
doSomething(line)
Is there a way to iterate through two files at once? Here's some pseudo code to help you understand..
with open('myfile.txt') as f: and with open ('myfile2.txt') as d:
for line in f and for line2 in d:
doSomething(line, line2)