[Tutor] pretty_printing

Dave Kuhlman dkuhlman at rexx.com
Mon Sep 4 00:50:04 CEST 2006


On Mon, Sep 04, 2006 at 09:41:26AM +1200, John Fouhy wrote:
> 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..
> 

The SciTE text editor, which runs on both Linux and MS Windows,
will export a Python source code file to HTML, PDF, RTF, LaTeX, and
XML.  See:

    http://www.scintilla.org/SciTE.html

The export feature is under the File/Export menu item.  SciTE also
does syntax highlighting/colorizing of Python code.

Dave

-- 
Dave Kuhlman
http://www.rexx.com/~dkuhlman


More information about the Tutor mailing list