This follows the tutorial by Carl Tashian
Basically, using the enscript program from command line. One has to use the following command
enscript -1rG --line-numbers -p out.ps --highlight=python -c inputfile.pyEnscript has a lot of options. Here are the most valuable options:
-1 -2 -3 -4number of columns per page-rrotate (landscape mode)-Gfancy header (with filename, date & time)--color=1if you have a color printer-whtml if you want HTML output instead of PostScript--help-highlightwill show which languages have syntax highlighting available