from tkinter import *
from tkinter import filedialog
win=Tk()
win.geometry("350x200")
win.title("Code Feet")
win.wm_resizable(False,False)
def opencofetfile():
i=filedialog.askopenfilename(initialdir="C:/desktop",title="Open txt file",filetypes=(("txt files","*.txt"),))
text= open(i,"r")
stuf=text.read()
codes.insert(END,stuf)
text.close()
def createfile():
f = filedialog.asksaveasfile(mode='w',filetypes=(("txt files","*.txt"),))
if f is None:
return
text2save = str(codes.get(1.0, END))
f.write(text2save)
Menubar=Menu(win)
Appearance= Menu(Menubar)
Menubar.add_cascade(label="Open",menu=Appearance)
Menubar.add_cascade(label="Save",menu=Appearance)
Appearance.add_cascade(label="Open cofet file",command=opencofetfile)
Appearance.add_cascade(label="Save cofet file",command=createfile)
win.config(menu=Menubar)
codes = Text(win)
codes.pack(fill=BOTH)
win.mainloop()
nerhaba ben not defteri yapıyorum ama her satırı farklı algılamasını istiyorum