''' Purpose: examine a web file and report on it Name: Computing id: ''' # get a hold of the local module url for web support from url import get_contents # define repository for text files of interest TEXT_REPOSITORY = "http://www.cs.virginia.edu/~cs1112/text/" # input name of web file file_name = input( "Enter name of web file: " ) # define the link to the web file -- TEXT_REPOSITORY + name of the web file link = TEXT_REPOSITORY + file_name # get the text contents of the date file using url function get_contents() text = get_contents( link ) # split text into a list of words words = text.split() # input indices of interest reply = input( "Enter indices of interest: " ) # split indices reply into a list of numeric strings nstrings = ... # produce a list of numeric indices from the numeric strings indices = ... for ns in nstrings : ... ... # run through the indices and print the associated word from words for i in indices : ... ...