[Tutor] print a line in IDLE as bold, italics or a color

Alan G alan.gauld at freenet.co.uk
Wed Aug 3 09:02:37 CEST 2005


> Error messages in IDLE also get a color (red), so it loooks to be 
> standard 'IDLE'/python;-)
> Also IDEL recognize keywords while typing and changes the color (to 
> orange), so it is quite normal in IDLE...
> But now; how can user's python program use it?

IDLE is written in Tkinter so it uses the same techniques that
you would use to change the colour of text in a Text widget.
But IDLE does not expose the Text widget to you as a user.

In fact it doesn't make much sense for IDLE to do that since IDLE is
only a development tool. It is not where you are expected to run
your programs. THus IDLE tries to mimic the environment where
your programs should run not to provide facilities that would
only work within IDLE.

Is there any reason why you want to change the ouput only in IDLE?
Or do you really want to be able to control the output of your
program wherever it runs? If the latter then you will need to
create your own Text window and display the output there.

Alan G. 



More information about the Tutor mailing list