Basic search engine in python