The Program I need help is written below
def countHits(file):
f2 = open(file,'rU')
l2 = f2.readlines()
f2.close()
user_input = raw_input("Enter the URL that you wish to chck fr the nmber of Hits")
print "The number of HITS for the given STRING/URL is : %s"%(l2.count(user_input))
def main():
strin = raw_input("Enter the file name\n")
countHits(strin)
if __name__ == '__main__':
main()
The file given as input contains list of urls (mentioned below):
/RLSsdTfswds/images//innercontainer-collapse.gif
/RL/css/default.css
/RLSTsdsdRdsdU/scripts/highslide/graphics/outlines/rounded-white.png
/RLSsdsdTsdsRsddU/scripts/highslide/graphics/zoomout.cur
/RLS/css/highslide/highslide/graphics/loader.white.gif
/RL/css/default.css
/RLST/rws/scripts/processschScript.js
/RLSR/scripts/NumberFormat.js
/RL/css/default.css
My query is that when I try to find url "/RL/css/default.css", the program doesn't gives me the count. Help me where I'm making a mistake ?
\nor another endline and your string don't so they aren`t actuually equal