Question: This code is implemented and working, I just need someone to comment it out to explain what each part of the code is doing. The

This code is implemented and working, I just need someone to comment it out to explain what each part of the code is doing. The top of the code is basically a description of what the overall code does. I just need more detailed comments within the code itself explaining what each line does. I will also post the other function that is called within this function so you get a more complete picture.  This code is implemented and working, I just need someone to
comment it out to explain what each part of the code is
doing. The top of the code is basically a description of whatI just need the top picture commented out more clearly and any variable name change suggestions or code restructuring recommendations are appreciated. (i.e to avoid using the break) . The code works, I just want it as readable and efficient as possible. Thanks. Good reviews for anyone who does this well!

H JES-finalproject2 py Fde Edit Watcher MediaTools JES Functions Window Layout Help ng function from abore to make it search # I want to modify the Horspoolatchi # a webpage for a given string and to create an output file that # contains # searched string and higlight the searched string in some manner. each occurrence in context (50 characters before and after the Python provides modules to support access to the Internet without all the overhead of a browser. Basically, you can write small programs that are clients Python module urllib allows you to open URLS and read them as if they were filea As an example, we can access the news Web site http://www.cnn.com and dispay s " 00 the first 100 characters of the Web page that gets returned...by doing the following import urllib connect urllib.urlopen ("http://www.cnn.com" 01|: >>> news=connect.read() connect.close ) snews [0:100] 10 import urllib " def HorspoolMatching2 (string, webpageURL) result result beg#0 = urllib.urlopen (webpageUR.) = result.read() try: while (True): i, j # Horspoo!Matching (string, result[beg:)) if ins-1: break isbegt conte beg itlen (string) -1 resliat.append (context) xt- resultti-51;i]+" result(i;i+len (string,1+"+result[i+1en(stringhi.ien (string)+ except IndexEETOrt print "done i return renlist

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!