¡@

Home 

python Programming Glossary: list_of_urls

Python : List of dict, if exists increment a dict value, if not append a new dict

http://stackoverflow.com/questions/1692388/python-list-of-dict-if-exists-increment-a-dict-value-if-not-append-a-new-dic

append a new dict I would like do something like that. list_of_urls 'http www.google.fr ' 'http www.google.fr ' 'http www.google.cn.. ' urls 'url' 'http www.google.fr ' 'nbr' 1 for url in list_of_urls if url in f 'url' for f in urls urls 'nbr' 1 else urls.append.. as values like 'http www.google.fr ' 1 urls_d for url in list_of_urls if not url in urls_d urls_d url 1 else urls_d url 1 This code..