Color schemes

M

Mark Schonewille

Hi,

Is anyone using a color scheme for his Python scripts? I suspect
most people are using a text editor which may or may not support
colorisation of scripts (like Apple's Script Editor does).

The page at
<http://interscript.sourceforge.net/interscript/doc/en_iscr_0328.html>
contains a colorized tokenizing script. I assume the script can
be used to make colour schemes and that a similar script is used
to create all the scripts shown on the website.

Do you use a similar script in a Python IDE or in your text
editor to colorize your Python scripts?

Mark
 
J

Josiah Carlson

Mark Schonewille said:
Hi,

Is anyone using a color scheme for his Python scripts? I suspect
most people are using a text editor which may or may not support
colorisation of scripts (like Apple's Script Editor does).

All editors that I would choose to use have built-in syntax highlighting.
Being color-sensitive, I find this a major win for productivity, similar
to having a 'find' dialog, multiple open documents, etc.

The page at
<http://interscript.sourceforge.net/interscript/doc/en_iscr_0328.html>
contains a colorized tokenizing script. I assume the script can
be used to make colour schemes and that a similar script is used
to create all the scripts shown on the website.

I would say that it is likely that such a script was _used to help
produce the web pages_ that present the source code of the modules at
the site. Whether or not the page authors used the web pages that had
been generated via this method as documentation themselves, in order to
help later work on the project, does not seem specified on the web page,
though it is both possible and likely.

Do you use a similar script in a Python IDE or in your text
editor to colorize your Python scripts?

Sych scripts are only necessary when one wants to post a "pretty"
version of Python source on a web site. Being that I have no desire,
nor need to post such things, I do not use it. Pure source without line
numbers is much easier to copy/paste. Sourceforge, on the other hand,
does present users with syntax highlighted text representations of code
when viewed through CVS. For example, here is the much loved asyncore.py
as viewed through Sourceforge's web CVS:
http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Lib/asyncore.py?view=markup

Ahh, so pretty. They use, I'm sure, some variant or reimplementation of
a colorization script, though not necessarily the one that is offered on
the page you link.

- Josiah
 
M

M.E.Farmer

Mark Schonewille said:
Hi, Hello!
Is anyone using a color scheme for his Python scripts? Yes.
I suspect most people are using a text editor which may or may not support
colorisation of scripts.
Good intuition, because some do and some don't :)
Many of the python editors out now are based on Scintilla.
Scintilla is a capable, colorizing, folding, text widget on 'roids.
Do you use a similar script in a Python IDE or in your text
editor to colorize your Python scripts?
I use an editor that is based on Scintilla .
To convert python source to colorised html for webpages and documentation,
I have been writing a module called PySourceColor.
It is a based on token and tokenize.
If you are intrested you can find it here:
'http://bellsouthpwp.net/m/e/mefjr75/'
This is a new version and has many improvements.
Also there is a version of pydoc there that serves up colorized html.
HTH,
M.E.Farmer
 
M

Mark Schonewille

Josiah and M.E.,

Thanks you for your replies. As I understand from your answers,
the colorised scripts on web sites have little to do with the
use of colorisation in script editors by Python programmers, but
those programmers who prefer an editor with colorisation
features probably apply colorisation rules similar to the pretty
looking scripts on websites and there probably is't a standard
colour scheme.

Best,

Mark
 
J

Jorgen Grahn

those programmers who prefer an editor with colorisation
features probably apply colorisation rules similar to the pretty
looking scripts on websites and there probably is't a standard
colour scheme.

The scheme is more likely to be standardized across languages in the editor
than across editors for a language. Gnu Emacs, for example, defaults (on my
system) to red for comments and a kind of pinkish red for string constants
regardless of language.

/Jorgen
 
M

M.E.Farmer

Mark Schonewille said:
Josiah and M.E.,

Thanks you for your replies.

You are welcome Mark and thanks for the followup.
It is always nice to know if the OP even got the reply ;)
As I understand from your answers,
the colorised scripts on web sites have little to do with the
use of colorisation in script editors by Python programmers, but
those programmers who prefer an editor with colorisation
features probably apply colorisation rules similar to the pretty
looking scripts on websites and there probably is't a standard
colour scheme.

Exactly!
PySourceColor *is* an attempt to colorize as well as Scintilla.
As far as I can tell there is not a default color scheme.
Maybe Idle or PythonWin.
And there are always Vim, and emacs......I am sure some one loves
those too.
I prefer the dark color scheme from PySourceColor, dark exactly
matches my editor. I bet most people feel most comfortable with
whatever they use most.
The colors develop associations.
If there is a concensus on the default color scheme I would be
intrested in knowing.
What is most liked or needed ?
Printing good colorized source is diffrent then viewing colorized
source.
I prefer light text on dark page on a monitor (bad eyes) , but dark
text on light page to print (saves ink).
Diffrent color schemes are needed for diffrent applications.

Now I have a question.
What are you trying to do, or is this just for general knowledge?
Just curious,
M.E.Farmer
 
N

Neil Hodgson

M.E.Farmer:
As far as I can tell there is not a default color scheme.
Maybe Idle or PythonWin.

There is a bit of inheritance here: many environments that use Scintilla
start with the default colour scheme used by SciTE which was based on
PythonWin, and I think that PythonWin got the basics (blue keywords and
green comments) from Visual C++.
I prefer light text on dark page on a monitor (bad eyes) , but dark
text on light page to print (saves ink).
Diffrent color schemes are needed for diffrent applications.

It is not just the waste of ink. Most printers are very poor at printing
black or dark backgrounds, with ink bleeding into characters or light
streaks and other marks on laser printers.

Neil
 
M

M.E.Farmer

Neil Hodgson said:
There is a bit of inheritance here: many environments that use Scintilla
start with the default colour scheme used by SciTE which was based on
PythonWin, and I think that PythonWin got the basics (blue keywords and
green comments) from Visual C++.

Isn't PythonWin now based on Scintilla too? Circular refrences ;)
It is not just the waste of ink. Most printers are very poor at printing
black or dark backgrounds, with ink bleeding into characters or light
streaks and other marks on laser printers.

Neil

Good point, the one time I did print light on dark it looked horrible...streaks.
While I am at it i want to THANK YOU for your work. I benefit from it every day.
Scintilla is awesome, and so are you, thanks Neil!
M.E.Farmer
 
N

Neil Hodgson

M.E.Farmer:
Isn't PythonWin now based on Scintilla too? Circular refrences ;)

Yes, but PythonWin first used RichEdit for syntax colouring which was
hard to make work well and so was turned off by default.

Neil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top