When coding in IDLE im not getting syntax highlighting?

This is the place for queries that don't fit in any of the other categories.

When coding in IDLE im not getting syntax highlighting?

Postby JanW » Mon Feb 25, 2013 8:50 pm

When you type something in the IDLE/Python Shell you get al these fancy colors for methods, import, print statments, and what-have-you's
I don't have the colors when working in a 'new-window'.
But just now i loaded a script form someone else and everything was color coded.

Is there a way you can turn this on/off?
Last edited by Yoriz on Thu Feb 28, 2013 7:06 pm, edited 1 time in total.
Reason: Changed title
JanW
 
Posts: 7
Joined: Sat Feb 16, 2013 8:35 pm

Re: Beginner no color's when coding

Postby ichabod801 » Mon Feb 25, 2013 8:58 pm

I'm not observing the behavior you are. I get syntax highlighting no matter what, even from new window. I don't think you can turn off syntax highlighting in IDLE. I think you'd have to make a custom highlighting set that basically didn't change any colors and use that.
Craig "Ichabod" O'Brien
Minimalist, buddhist, theist, and programmer
Current languages: Python, SAS, and C++
Previous serious languages: R, Java, VBA, Lisp, HyperTalk, BASIC
ichabod801
 
Posts: 84
Joined: Sat Feb 09, 2013 12:54 pm
Location: Outside Washington DC

Re: Beginner no color's when coding

Postby micseydel » Mon Feb 25, 2013 9:23 pm

I've used IDLE such that it didn't syntax highlight until it knew that it was working with Python code. As soon as you save a .py file, it should syntax highlight, and if you want it to always do it I'd ask ichabod what version of IDLE he's using.
Join the #python-forum IRC channel on irc.freenode.net!
User avatar
micseydel
 
Posts: 1126
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Re: Beginner no color's when coding

Postby ichabod801 » Mon Feb 25, 2013 11:15 pm

micseydel wrote:I've used IDLE such that it didn't syntax highlight until it knew that it was working with Python code. As soon as you save a .py file, it should syntax highlight, and if you want it to always do it I'd ask ichabod what version of IDLE he's using.


I believe that was the version that shipped with 3.3. It was on my work machine, but I can double check tomorrow.

Edit: I double checked, it was the IDLE that shipped with 3.3 (for Windows).
Last edited by ichabod801 on Tue Feb 26, 2013 3:38 pm, edited 1 time in total.
Craig "Ichabod" O'Brien
Minimalist, buddhist, theist, and programmer
Current languages: Python, SAS, and C++
Previous serious languages: R, Java, VBA, Lisp, HyperTalk, BASIC
ichabod801
 
Posts: 84
Joined: Sat Feb 09, 2013 12:54 pm
Location: Outside Washington DC

Re: Beginner no color's when coding

Postby Mekire » Mon Feb 25, 2013 11:28 pm

Mic's assertion should be spot on. I used IDLE for a long time without knowing better. Occasionally I would save files without extensions since it doesn't default to .py. As soon as you do this you lose all syntax highlighting. It should however, while working with an as yet unsaved file, default to python syntax highlighting.

-Mek
User avatar
Mekire
 
Posts: 983
Joined: Thu Feb 07, 2013 11:33 pm
Location: Amakusa, Japan

Re: Beginner no color's when coding

Postby JanW » Tue Feb 26, 2013 7:10 pm

I got it now. I was under the impression Python saved everything as a '.py' file but clearly i did not. I did a 'Save As' with .py extension behind the file name and there your go, color!

Thanks guys.
JanW
 
Posts: 7
Joined: Sat Feb 16, 2013 8:35 pm


Return to General Coding Help

Who is online

Users browsing this forum: freddyhard, Google [Bot], micseydel and 3 guests