"Madhur" schrieb > I would like to know the best way of generating filter > of two files based upon the following condition > [...] > Sounds like homework. Here some suggestions:
- for each file, create a dictionary (see help(dict) in the python shell for details) and populate it with the values, so that e.g. d1['def'] = 'abc def hij' (help("".split), perhaps help("".strip)) - for each key in the first dictionary, look whether it exists in the second, if not, write the value (the line extracted in the first step) out. (help(dict.iteritems), help(dict.has_key)) (Note that for if a_dict.has_key("def"): pass one can also write if "def" in a_dict: pass but you won't find this in the simple on-line help, at least in my version) HTH Martin -- http://mail.python.org/mailman/listinfo/python-list