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.
Due to the reasons discussed here we will be moving to python-forum.io on October 1st, 2016.
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
ichabod801
 
Posts: 687
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.
Due to the reasons discussed here we will be moving to python-forum.io on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
micseydel
 
Posts: 2992
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.
Due to the reasons discussed here we will be moving to python-forum.io on October 1st, 2016.
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
ichabod801
 
Posts: 687
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
New Users, Read This
  • Use code tags when posting code.
  • Include any errors with your post (in code tags).
  • Describe your problem; not your chosen solution.
  • Make examples the minimum length to demonstrate your issue.
User avatar
Mekire
 
Posts: 1711
Joined: Thu Feb 07, 2013 11:33 pm
Location: Tucson, Arizona

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: No registered users and 11 guests