Python IDLE syntax coloring (highlighting) of prin

2019-09-21 16:56发布

问题:

Is Python IDLE consistent regarding syntax coloring (highlighting) of print?

I tested using IDLE 2.7.2. Sometimes it recognizes as a keyword. Sometimes as built-in ( such as list() or tuple() ). Both of them are, IMHO, correct; so IDLE is inconsistent?

Let me know your opinion.

KW

Added a screenshot 2012 04 01 18:27 KST (April fool's day but the shot is true.)

Link to my screenshot

How I made this:

  • Second print will be built-in from the beginning.
  • The last(=fourth) print is more tricky. First leave no blank line between the third and the fourth print. Then the fourth print is a keyword.
  • If I put insertion point (=cursor) at the end of the third print and press [Enter] key, the fourth print finally becomes a built-in.

Please let me know if I can have some more positive feedback now :)

回答1:

Without examples or screenshots there isn't really much we can do here, but if you really want great Syntax Highlighting and error detection I'd recommend using an IDE like PyCharm. It is not open source but it is the best Python IDE I've tried.



回答2:

This has been fixed: http://bugs.python.org/issue6528