You say you want to reference each line from the while loop... but you don't have a while loop in your program. Also what's the purpose of your variable hits and the variable I (why the two variables? ).
I've made some edits to your code. I'm using python 2.6 so I changed input to raw_input and added from future import print_function I then changed to do readlines() to read the complete file into line I split on " " so that you won't split on each character. I have no idea what you are thinking here: url = infile.readline() Your output indicates you want to print a url but you have a text file for input, and that doesn't add up to a url, so think about what you really want there.
Take a look and perhaps refine your question. From __future__ import print_function def main(): print("The Great Search Engine, by Eric Santos") # input from user name of database file dname = raw_input("Enter name of database file: ") # input from user seach term to look for term = raw_input("Enter keyword to search for: ") # open html file for writing outfile = open("mypage. Html", "w") # open database file for reading infile = open(dname,"r") # for each line in the file: hits=0 I = 0 for line in infile.readlines(): print(line) listword = line.
Split(" ") print(listword) for word in listword: if term == word: print(word) print(line) # read in URL line url = infile.readline() print(url) hits=hits+1 i=i+1.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.