Difference between revisions of "CSC352 Homework 2 Solution 1"

From dftwiki3
Jump to: navigation, search
(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
 
#
 
#
# feed key words, get list of docs, then download docs
+
# This program gets a keyword from the command line, and
# and process them
+
# 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

Revision as of 17:41, 22 February 2010

--D. Thiebaut 22:38, 22 February 2010 (UTC)



...