compare dictionary values

rbt rbt at athop1.ath.vt.edu
Fri Dec 30 14:16:35 EST 2005


What's a good way to compare values in dictionaries? I want to find 
values that have changed. I look for new keys by doing this:

new = [k for k in file_info_cur.iterkeys() if k not in 
file_info_old.iterkeys()]
         if new == []:
             print new, "No new files."
         else:
             print new, "New file(s)!!!"

My key-values pairs are filepaths and their modify times. I want to 
identify files that have been updated or added since the script last ran.

Thanks,
rbt



More information about the Python-list mailing list