finder

finder - print("First occurrence at: ",where)...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
def showString(url,search): import urllib.request page = urllib.request.urlopen(url) text = page.read().decode("utf8") where = text.find(search) before = where - 10 after = where + 10
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: print("First occurrence at: ",where) print("Context: ",text[before:after]) showString('http://www.krhs.net/new08/Guidance%20Office/index.html', 'school ')...
View Full Document

This document was uploaded on 04/28/2011.

Ask a homework question - tutors are online