I am trying to take text from the user via tkinter and put it into a text file. I got the program to write something to the text file, but it is not what the user enters, but rather a bunch of random numbers and characters. Here is my code.
import Tkinter
from Tkinter import *
def writeFile (textObj):
file = open("alaskaQuestion.txt",'a+')
file.write(textFile2)
textObj.insert(INSERT, file.read())
file.close()
gui = Tkinter.Tk()
textFile2 = Tkinter.Entry(gui)
textFile2.grid(row=9, column=1)
textFile2 = str(textFile2)
buttonWrite = Tkinter.Button(gui, text = "Write To File", command = lambda: writeFile(textFile)).grid(row=8, column=1)
gui.mainloop()