[Tutor] pretty_printing

John Fouhy john at fouhy.net
Sun Sep 3 23:41:26 CEST 2006


On 04/09/06, Lowell H. Tackett <chiselchip at earthlink.net> wrote:
> I would like to---so far without luck--to print out my Python scripts with
> syntax highlighting (using Mandrake Linux as my OS/host.)  Using enscript has
> not gotten me anywhere; nor has a package I found on the *net called
> 'pretty-print', or some such similar to that.

Well, you could open your code in vim or emacs and click "print"? :-)

> It occured to me that it ought to be very simple to gain access to those
> syntax discrimnators, write a code script that creates a 'dye' for each
> syntax type, and pipe a print request thru such a file.

Well, on this windows system, the vim python syntax file is in
Vim\vim70\syntax\python.vim.

It looks like you could make a reasonable stab at parsing it without
knowing what everything means, especially if you're willing to accept
the odd error.

I'm not sure how you want to go about colourizing things, though.  If
you have a postscript printer, you could generate your own postscript,
maybe..

-- 
John.


More information about the Tutor mailing list