[Edu-sig] Programming for the fun of it
Seth David Schoen
schoen@loyalty.org
Tue, 12 Dec 2000 23:02:56 -0800
NolmtxVip@aol.com writes:
> Hi everybody, I just joined the list. I am fairly new at python programming
> and I'm taking a course for it in Yorktown High School With Jeff Elkner (one
> of the people in this list) teaching it. Python seems like an interesting
> language, although C++ seems much more powerful.
That's an interesting question. In C++, you can write code which is
more _efficient_ and which has direct access to system memory and
(likely) to native operating system and library calls.
On the other hand, Python is full of objects and language features
which let you write effective, concise programs. That's a form of
power.
> I have a question to which
> I could not find the answer anywhere. How would you be able to change the
> text color for text in python? What is the code.
The most portable way is probably to use curses. See, e.g.,
http://www.python.org/doc/howto/curses/curses.html
curses and similar libraries let you do color and text graphics using
the capabilities of a particular terminal or display type, without
hard-coding escape characters or system calls that are specific to
that display.
--
Seth David Schoen <schoen@loyalty.org> | And do not say, I will study when I
Temp. http://www.loyalty.org/~schoen/ | have leisure; for perhaps you will
down: http://www.loyalty.org/ (CAF) | not have leisure. -- Pirke Avot 2:5