Printing Code

posted August 23rd 2006 at 0357 EDT in All, Linux, Programming, Windows

I don't normally print out the code I write because it just turns out horribly on paper, and you need line numbers on code.

That said, I happened across this command string when a co-worker printed out some code, and I'm happy with the results. It's pretty slick.


user@host$ nenscript -2Gr -C yourTextFileOfCode.py
 

I'll leave it to you to figure out what the cryptic options do, but I will include a screen shot of how it prints.


Now enjoy some nice printouts next time you need to run of 30 copies of that page of example code.

Nenscript is an ascii->postscript formatter. Available for windows and linux.

There are plenty of tools to turn postscript files into pdf files if you need that instead of printing

<warning> That horrid html code is my index page... I know I know it's bad </warning>

2 Responses

  1. #1 Wuxia » Printing Code
    1 year, 12 months ago

    […] read more | digg story […]

  2. #2 lolajl
    1 year, 12 months ago

    For OS X, enscript is included - just replace nenscript with enscript.

Leave a comment