I am trying to highlight a word or a letter in python console automatically when using input
(i.e. when we are typing , if our desired word to be highlighted is found then highlight it with a given color). Like we see in iPython
. When we our typing our command in iPython
, it automatically highlights statements. How can I do that?
I think os.system
or some other module like Pigments
may do that job.
-
"IPython is BSD-licensed, open-source software ..." (from ipython.org; my emph.). So you can literally check how it works.– JongwareOct 10, 2018 at 20:00
-
@usr2564301 Can you help me find highlighting file from github.com/ipython/ipython ?– NoumanOct 11, 2018 at 2:40
-
@usr2564301 I think this is the file github.com/ipython/ipython/blob/master/IPython/lib/lexers.py . But its not nearly human readable– NoumanOct 11, 2018 at 3:02
-
And I also think that this file contains the code for highlighting: github.com/ipython/ipython/blob/master/IPython/terminal/… From line 280– NoumanOct 11, 2018 at 3:09
Add a comment
|