Quick Python color coding in editing question

In summary, the conversation discusses the issue of IDLE losing syntax highlighting while programming in Python. The reason for this is saving a file without the proper extension. It is suggested to use a different editor or IDE instead of IDLE. The individual, who is new to programming, plans to try out different editors to resolve the issue.
  • #1
DrummingAtom
659
2
When I've been programming in Python for a while I noticed that the color coding in IDLE goes away. If I restart IDLE, the colors come back. Why is it doing this? How can I maintain the color in there without having to restart a bunch of times?

Thanks
 
Technology news on Phys.org
  • #2
The only reason I've noticed IDLE losing syntax highlighting is saving a Python file without the proper extension, but I haven't used IDLE in a long time. (I write Python in gedit and run my scripts from the terminal on a Linux box.)

You may want to consider using a different editor/IDE than IDLE, for me it's always been troublesome.
 
  • #3
jhae2.718 said:
The only reason I've noticed IDLE losing syntax highlighting is saving a Python file without the proper extension, but I haven't used IDLE in a long time. (I write Python in gedit and run my scripts from the terminal on a Linux box.)

You may want to consider using a different editor/IDE than IDLE, for me it's always been troublesome.

That was it exactly. I wasn't using the .py extension. I'm very new to programming so I haven't experimented with a different editor yet, I'll download some others and play around. Thanks for your help.
 

Related to Quick Python color coding in editing question

1. How do I change the color of my code in Python?

To change the color of your code in Python, you can use a code editor such as Visual Studio Code or PyCharm. These editors allow you to customize the color scheme to your preference. You can also use Python-specific code editors such as IDLE or Sublime Text.

2. Can I customize the color of specific elements in my code?

Yes, most code editors allow you to customize the color of specific elements in your code. For example, you can change the color of keywords, strings, comments, and more. This can make your code more readable and easier to navigate.

3. How do I change the default color scheme in Python?

To change the default color scheme in Python, you can go to the preferences or settings of your code editor and find the option to change the color scheme. You can also import custom color schemes from other users or create your own.

4. Is there a specific color scheme that is recommended for Python coding?

There is no specific color scheme that is recommended for Python coding. It is a matter of personal preference and what is most comfortable for you to read and work with. However, some popular color schemes for Python include Monokai, Solarized, and Dracula.

5. Can I share my custom color scheme with others?

Yes, most code editors allow you to export and share your custom color scheme with others. This can be useful if you work on a team or want to share your preferred color scheme with others in the Python community.

Similar threads

  • Programming and Computer Science
Replies
1
Views
1K
Replies
6
Views
1K
  • Programming and Computer Science
Replies
0
Views
1K
  • Programming and Computer Science
Replies
10
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
3
Views
473
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
15
Views
1K
  • Programming and Computer Science
Replies
7
Views
1K
  • Programming and Computer Science
Replies
8
Views
1K
Back
Top