How to use pygments with readline to colorize the input text according to the tokens?
问题 I want to develop a Python theme which executes Python codes and which colorize the tokens in input() while users typing some text. Recently I have started to learn readline and pygments. I can add keyword tokens to the tab completion. Also i can colorize the stdout text with pygments highlight function. But still i can't colorize the tokens in input(). Is there anyone to give me an idea to do what i want? The codes below are from an example application. import readline from pygments.token