Need help writing to a file in Python : I am making a French Translator and purely for experience I want to make a 'Save' button they will save what is currently entered into the entry fields.

    e1 = Entry(master)
    e2 = Entry(master)
    
    e1.grid(row=0, column=1)
    e2.grid(row=1, column=1)
    
    def write():
            name = 'SavedFile.txt'
            hello = int(3)
            file = open(name,'w+') 
            file.write(e1.get()) 
    
            file.close()
    
    menubar = Menu(master)
    master.config(menu=menubar)
    filemenu = Menu(menubar, tearoff=0)
    filemenu.add_command(label="Save", command=write())
Changing file.write(e1.get()) to file.write('hello'), works and writes 'Hello' to SavedFile.

But I want it so when I click 'Save' under 'File', it rewrites to the file (preferably without overwriting what is there)

P.s.,

    s = e1.get()
will actually make s = to whatever is currently in the field