Try the listings package included in the standart TeTeX distribution. It will pretty print your code in any language (Python included). Through format options it should be easy to color the output. Cheers Martin