Difference between revisions of "CSC352 Homework 2 Solution 1"
(Created page with '--~~~~ ---- <onlydft> <source lang="python"> #! /usr/bin/python # D. Thiebaut # threadedRetrieveEtext.py # # feed key words, get list of docs, then download docs # and process t…') |
|||
Line 8: | Line 8: | ||
# threadedRetrieveEtext.py | # threadedRetrieveEtext.py | ||
# | # | ||
− | # | + | # This program gets a keyword from the command line, and |
− | # and | + | # launches a thread that accesses a server and prompts it for |
+ | # a list of 20 Urls of files containing that keyword. | ||
+ | # The program then launches 20 threads on the 20 different threads | ||
+ | # and parallelizes the wait of the 20 threads. | ||
+ | # When the 20 threads are done, the main program gets the | ||
+ | # excerpts from each file with a few words before and after the | ||
+ | # keyword, and prints the results on the screen. | ||
+ | |||
import sys | import sys | ||
import urllib, urllib2 | import urllib, urllib2 |