Search code examples
functionpython-3.5python-idle

How to make functions appear purple


So from just learning how to make functions, I thought of if I could turn the function purple, just like a normal print() or str() function. And with that in mind, it may seem pretty obvious that I am still a beginner when it comes to coding. From what I know, it may have something to do with sys.stdin.write, but I don't know. This will help me to make different languages for others who don't speak or write English.


Solution

  • In Options => Configure IDLE => Settings => Highlights there is a highlight setting for builtin names (default purple), including a few non-functions like Ellipsis. There is another setting for the names in def (function) and class statements (default blue). You can make def (and class) names be purple also.

    This will not make function names purple when used because the colorizer does not know what the name will be bound to when the code is run.