I want to save information in a text file from a Tkinter-based app.

```
def SaveInfo():
    NameInfo = NameVar.get()
    SurnameInfo = SurnameVar.get()
    f = open('cv.txt', 'w')
    print (NameVar.get(), SurnameInfo)
    f.write(f'name - {NameInfo}')
    f.close()

NameVar = StringVar()
Label(MainInfo, text='Name ', padx=5, pady=5).grid(row=1, column=1)
Name = Entry(MainInfo, textvariable=NameVar).grid(row=1, columnspan=3,
        column=2)
SurnameVar = StringVar()
Label(MainInfo, text='Surname ', padx=5, pady=5).grid(row=2, column=1)
Surname = Entry(MainInfo, textvariable=SurnameVar).grid(row=2,
        columnspan=3, column=2)

Submit1 = Button(MainInfo, text='Submit',
                 command=SaveInfo()).grid(row=10, column=3)

```

It neither prints anything nor saves any information when I enter something in the Entry.