I have text files with a few thousands words in them (one word in a line).
I've written a function which take two words (strings), and checks if one
word is an Anagram of the other (that means if the two words contains the same
letters, even if in different order).

Now I want to go over my huge text file and search for anagrams. My output should be a list which contains tuples of couple of words which
are anagrams.

The problem is that I have no idea how to go over the words with a for/while loop. Everything I've tried has failed. (I'm clear with the way of doing it, but I just don't know python well enough).

edit#1:
Assuming I want to go over lines 1 to 100 in the text instead of the whole text, how do I do that?