473,466 Members | 1,294 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 3118
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Edilmar | last post by:
Hi, First of all, I'm new in Python... I have worked with manu langs and IDEs, like Delphi, VB, JBuilder, Eclipse, Borland C++, Perl, etc... Then, today I think IDEs like Delphi have a...
4
by: Fuzzyman | last post by:
I looked through the manual, I looked on the web and could find very little on this subject.... The closest I could find was : http://www.faqts.com/knowledge_base/view.phtml/aid/4549. Saying...
0
by: Jody Burgess | last post by:
The example in this post appears to be incomplete, -----Original Message----- > From: Tim Golden > Sent: 03 October 2003 09:49 > To: 'Kevin' > Cc: python-list@python.org > Subject: RE:...
1
by: uri bushey | last post by:
So I have a tkinter based little program in Python that has a canvas loaded with a WaveSurfer (http://www.speech.kth.se/wavesurfer/) widget. I am trying to print the contents of the WaveSurfer...
2
by: xegfault | last post by:
Here is a simple script: #!/usr/bin/python print "No newline, please.", # End of script When the program runs, python is still printing a newline when the program exits. How does one keep...
2
by: S. Staats | last post by:
Good day, everbody. Here is a simple program called test.py: #!/usr/bin/python print "No newline, please.", # End of program Here is what program does: prompt> ./test.py No newline, please.
2
by: David Isaac | last post by:
I'd like to try personal financial management using Python. I just found PyCheckbook, but it does not support check printing. Is there a Python check printing application kicking around? Thanks,...
8
by: David Isaac | last post by:
"Alan Isaac" <aisaac0@verizon.net> wrote in message news:_A34e.2207$1r6.248@trnddc02... > I'd like to try personal financial management using Python. > I just found PyCheckbook, but it does not...
3
by: Max | last post by:
How can I print (as in laser printer, not the python print statement) HTML from Python (actually it doesn't have to be HTML - it's tabular data with some rows/columns highlited). The project...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.