compare dictionary values
- From: rbt <rbt@xxxxxxxxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 14:16:35 -0500
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 .
- Follow-Ups:
- Re: compare dictionary values
- From: Marc 'BlackJack' Rintsch
- Re: compare dictionary values
- Prev by Date: Re: IRC sockets and queries
- Next by Date: Re: oop in python
- Previous by thread: Pyrex on Darwin, gcc 3.3 optimization trouble
- Next by thread: Re: compare dictionary values
- Index(es):
Relevant Pages
|