470,594 Members | 1,444 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,594 developers. It's quick & easy.

Python Color Printing

I'm pretty desperate to get color syntax printing. I just tried out
the evaluation version of 'Komodo', which several people in here
suggested, and its print features are terrible. The text is coming out
huge when I print at 8 point, tiny when I'm printing at 14 point (so
tiny that it looks like subscripts), the margins are reset at random,
and so on. Plus it doesn't recognize all my fonts.

I don't care if the pretty printer is in an IDE. I just want color
printing with headers and footers! And I wanted it automated - I don't
want to have to print each one by hand, I want to start them all
printing and walk away. It has to be able to print in larger fonts
reliably, because 10 point is too small for my computer-weary eyes.

Does anyone have any suggestions?

--Kamilche
Jul 18 '05 #1
7 2947
Kamilche wrote:
I'm pretty desperate to get color syntax printing. I just tried out
the evaluation version of 'Komodo', which several people in here
suggested, and its print features are terrible. The text is coming out
huge when I print at 8 point, tiny when I'm printing at 14 point (so
tiny that it looks like subscripts), the margins are reset at random,
and so on. Plus it doesn't recognize all my fonts.

I don't care if the pretty printer is in an IDE. I just want color
printing with headers and footers! And I wanted it automated - I don't
want to have to print each one by hand, I want to start them all
printing and walk away. It has to be able to print in larger fonts
reliably, because 10 point is too small for my computer-weary eyes.

Does anyone have any suggestions?

--Kamilche


There is a GNU tool called source-highlight that handles python. It will create
a html file with the colour coding. You could then print the html file.

You'll have to google for it.
Jul 18 '05 #2
Kamilche wrote:
I'm pretty desperate to get color syntax printing. I just tried out
the evaluation version of 'Komodo', which several people in here
suggested, and its print features are terrible. The text is coming out
huge when I print at 8 point, tiny when I'm printing at 14 point (so
tiny that it looks like subscripts), the margins are reset at random,
and so on. Plus it doesn't recognize all my fonts.

I don't care if the pretty printer is in an IDE. I just want color
printing with headers and footers! And I wanted it automated - I don't
want to have to print each one by hand, I want to start them all
printing and walk away. It has to be able to print in larger fonts
reliably, because 10 point is too small for my computer-weary eyes.

Does anyone have any suggestions?


I generally look to PDF first for all my printing needs. In this
case, I'd use ReportLab and whatever conveniently syntax-colouring
script I stumbled over.

Automating the printing is probably simple enough from the command
line (i.e. os.system()), though I don't know the incantation, but
I'm sure it could also be automated fairly easily through the
Acrobat COM interface, assuming you're on Windows. On Linux I
am sure there are equivalent (and likely better :-) solutions.

-Peter
Jul 18 '05 #3
kl*******@home.com (Kamilche) wrote in
news:88**************************@posting.google.c om:
I'm pretty desperate to get color syntax printing. I just tried out
the evaluation version of 'Komodo', which several people in here
suggested, and its print features are terrible. The text is coming out
huge when I print at 8 point, tiny when I'm printing at 14 point (so
tiny that it looks like subscripts), the margins are reset at random,
and so on. Plus it doesn't recognize all my fonts.

I don't care if the pretty printer is in an IDE. I just want color
printing with headers and footers! And I wanted it automated - I don't
want to have to print each one by hand, I want to start them all
printing and walk away. It has to be able to print in larger fonts
reliably, because 10 point is too small for my computer-weary eyes.

Does anyone have any suggestions?

--Kamilche


Try SciTE which can be downloaded free from http://www.scintilla.org

It will print[*] any of its supported languages in colour, or can export to
HTML, Rtf, Pdf &c. The latest versions are scriptable (in Lua) so you
should be able to automate the process if you really have that many files.

Headers, footers, and fonts are all configurable through properties files
(and I expect configurable from scripts as well).
[*] Direct printing only works on windows, on other platforms you can
convert to pdf or html and print that.
Jul 18 '05 #4
Peter Hickman <pe***@semantico.com> wrote in message news:<40***********************@news.easynet.co.uk >...
There is a GNU tool called source-highlight that handles python. It will create
a html file with the colour coding. You could then print the html file.


Thanks, I've got one of those. But then, how do I handle adding
headers, footers, changing the window title to get rid of 'Microsoft
Internet Explorer', and automatically printing? That's the part where
it falls down on.

If someone knew how to do that via Python, that'd work! :-)

--Kamilche
Jul 18 '05 #5
On Thu, 24 Jun 2004 02:36:20 -0700, Kamilche wrote:
I'm pretty desperate to get color syntax printing. I just tried out
the evaluation version of 'Komodo', which several people in here
suggested, and its print features are terrible. The text is coming out
huge when I print at 8 point, tiny when I'm printing at 14 point (so
tiny that it looks like subscripts), the margins are reset at random,
and so on. Plus it doesn't recognize all my fonts.

I don't care if the pretty printer is in an IDE. I just want color
printing with headers and footers! And I wanted it automated - I don't
want to have to print each one by hand, I want to start them all
printing and walk away. It has to be able to print in larger fonts
reliably, because 10 point is too small for my computer-weary eyes.


GNU enscript supports highlighting (in color?). As well as headers,
footers, and a lot of other cool stuff.
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Jul 18 '05 #6
Duncan Booth <me@privacy.net> wrote in message news:<Xn***************************@127.0.0.1>...
Try SciTE which can be downloaded free from http://www.scintilla.org


Thanks, I'll check it out!
Jul 18 '05 #7
Kamilche wrote:
Peter Hickman <pe***@semantico.com> wrote in message
news:<40***********************@news.easynet.co.uk >...
There is a GNU tool called source-highlight that handles python. It will
create a html file with the colour coding. You could then print the html
file.


Thanks, I've got one of those. But then, how do I handle adding
headers, footers, changing the window title to get rid of 'Microsoft
Internet Explorer', and automatically printing? That's the part where
it falls down on.

If someone knew how to do that via Python, that'd work! :-)


Sometimes, simple, old tools can be very handy:

haar[~]> which codeps
codeps: aliased to enscript -G2rjE --color -o !*.ps !*; gv !*.ps
haar[~]> which codeprint
codeprint: aliased to enscript -G2rjE --color !*

This gives 2-up output, just remove the 2 option for single-page output.
enscript is a wonderful tool, I use this all the time to print code (and it
highlights many languages, not just python).

Cheers,

f
Jul 18 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Fuzzyman | last post: by
reply views Thread by Jody Burgess | last post: by
1 post views Thread by uri bushey | last post: by
2 posts views Thread by David Isaac | last post: by
8 posts views Thread by David Isaac | last post: by
3 posts views Thread by Max | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.