Я делал редактор кода и есть TabError.
from tkinter import *
import os
from tkinter.filedialog import *
from tkinter.messagebox import *
root = Tk("Note")
font_family = "Arial"
font_size = 18
def save_as():
global text
t = text_area.get("1.0", "end-1c")
savelocation=asksaveasfilename()
file1=open(savelocation, "w+")
file1.write(t)
file1.close()
def open():
__file = askopenfilename(defaultextension=".txt",
filetypes = (("All Files","*.*"),
("Text Documents","*.txt"),
("Python","*.py"),
("JavaScript","*.js"),
("HTML","*.html")))
file = open(__file, "r")
text_area.insert(1.0,file.read())
file.close()
text_area = Text(root, font=(font_family + " " + str(font_size) ))
text_area.grid()
#menu
menu = Menu(root)
root.config(menu=menu)
file_menu = Menu(menu, tearoff=0)
menu.add_cascade(label="File", menu=file_menu)
file_menu.add_command(label="Save as", command=save_as)
file_menu.add_command(label="Open", command=open)
file_menu.add_separator()
root.mainloop()