[python-win32] Retaining a value during a recursive function

James Matthews nytrokiss at gmail.com
Fri Nov 17 05:53:58 CET 2006


The function just overwrites the list in my function is there anyway i can
fix this!
def find_all_items(site):
    site = urllib.urlopen(site).read()
    all_items = re.findall(r'watch\.asp\?\w+\=\w*\&\w*\=\w+',site)
    next_page = re.findall(r'Watches\.asp\?\w+\=[0-9]+\&pg\=\w+',site)
    try:
        find_all_items(urllib.basejoin("<some url>",next_page[0]))
    except IndexError:
        pass
    return remove_dups(all_items) # ,<---- this removes all the duplicate
items

-- 
http://www.goldwatches.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20061116/795935a6/attachment.html 


More information about the Python-win32 mailing list