In <[email protected]> ishish <[email protected]> writes:
> The script [...] only creates batch1.csv. If the script only creates batch1.csv, that means Batch2 and Batch3 must be empty. > for k, v in myDict.items(): > if Batch1.has_key(k): > if k in Batch2.has_key(k): > Batch3[k] = v > else: > Batch2[k] = v > else: > Batch1[k] = v 'if k in Batch2.has_key(k):' is a very strange line of code. In fact, it should produce a syntax error if it were ever executed, because the 'in' keyword requires an iterable as the second part, and has_key() returns only True or False. Therefore, I would say that line of code never executes, which means that the preceding 'if Batch1.has_key(k)' statement always evaluates to False. Which therefore means that Batch2 and Batch3 never accumulate any items, matching your observed output. -- John Gordon Imagine what it must be like for a real medical doctor to [email protected] watch 'House', or a real serial killer to watch 'Dexter'. -- https://mail.python.org/mailman/listinfo/python-list
