[Tutor] keyword colors disappear

Peter Otten __peter__ at web.de
Sat Oct 11 14:14:32 CEST 2014


William Becerra wrote:

> Hey, I'm new to programming.
> Only have about 2 weeks of experience.
> Using Python 2.7.8 and running Windows 8
> I'm having the following problem.
> 
> I open Python shell  press file, new file and write my code(any code)
> then all the Python keywords appear in their different *colors*, for
> example print appears in orange, strings in green numbers in blue, etc.

>From your description I conclude that you are using IDLE. Is that correct?
(If you are not sure look into the help menu, there should be an "About 
IDLE" entry)

> Now here is the problem, after I press F5 and i run my code. Then i try go
> back to my code and add some more code or change the code. Now all ll the
> colors of the Python keywords are gone. Everything appears in  normal
> black and white text.
> Note: weather the code is correct or there is any errors I still have the
> same problem.
> 
> What i want to know is.
> Is there something i can do to keep the colors of the keywords? because it
> makes it easier for me to keep track of my code.
> 
> Hope what i asked is clear.

What is the suffix of the saved file? It should be '.py'. If the file name 
ends with with something else (on my linux machine even '.PY' doesn't work) 
IDLE may mistake the code for arbitrary text.



More information about the Tutor mailing list