Pythonic iteration over sliding window pairs in list?
You can go even simpler. Just zip the list and the list offset by one.
In [4]: zip(l, l[1:])
Out[4]: [('a', 'b'), ('b', 'c'), ('c', 'd'), ('d', 'e'), ('e', 'f'), ('f', 'g')]
How about:
for x, y in itertools.izip(l, l[1:]): print x, y