Look at this github project:
https://github.com/sanguineturtle/pygments-ipython-console
This package provides a Pygments_ lexer for IPython Console Files. The lexer is published as an entry point and, once installed, Pygments will pick it up automatically.