I have a web scraping script written in Python that I want to make multi-threaded. It scrapes web pages from a list, and enters results into a DB. Can someone (the author maybe) show me a simple example of how to make a multi-threaded Python script?
Check out the docs on the "multiprocessing" or "threading" module. In particular multiprocessing.Pool is handy for controlling the number of parallel things you have going on at once.
# Assume we have functions GetUrls() that retrieves a list
# of the urls we want to get, and Download(url) which
# downloads the content of a url and sticks it in the
# database.
import multiprocessing
pool = multiprocessing.Pool(processes=100)
urls = GetUrls()
pool.map(Download, urls)
Go to python.org and read the documentation on threading, concurrency. The mailing list under community is very good, but they expect you to have read the docs and goodled first.