I am trying to make a basic code editor in tkinter/python. And i want to add syntax highlighting for the text editor, but i cant find any resources that explain clearly how to add syntax highlighting for a tkinter textbox..
Source code
from tkinter import *
from tkinter import messagebox
#from pygments import *
# Window
root = Tk()
root.title("BasicText - None")
root.geometry("1000x400")
root.config(bg='#333333')
# Variables
FONT = 14
# Textbox
text = Text(root, bg="#333333", font=("Helvetica", FONT), fg='white', bd=0)
text.config(selectbackground='#333333', selectforeground='lightblue', insertbackground='white')
# Execute
if __name__ == '__main__':
text.pack(expand=1, fill='both', pady=5, padx=5)
root.mainloop()