0

This is my code with some bits removed, this sends output to a "Notes.txt" textfile but it normally just sends a decimal point followed by random decimal digits. Hopefully a beginner mistake. Code snippets below:

class Window (Frame):
    def __init__(self, master = None):
        Frame.__init__(self, master)
        self.master = master
        self.init_window()

    def init_window (self):#This sets up the 'Window Frame'
        self.master.title("'Joe Banks' - Witty name to follow")
        self.pack(fill=BOTH, expand=1)
        #Irrelevant File Menus and buttons removed
        #Adds Textbox for typing Notes etc.
        blankTextbox = Text(app, width = 30, height=4, font=("CenturyGothic",18))
        blankTextbox.place(x=270, y=550, anchor="c")

Then in a different procedure:

def saveTextboxToFile(self):
    fileContent = str(Text(app, width = 30, height=4, font=("CenturyGothic",18)))
    file = open("Notes.txt", "w")
    file.write(fileContent)
    file.close()
skrx
  • 19,980
  • 5
  • 34
  • 48
  • 1
    Take a look at this [answer](https://stackoverflow.com/a/14824164/6220679). – skrx Sep 09 '17 at 22:12
  • Possible duplicate of [How to get the input from the Tkinter Text Box Widget?](https://stackoverflow.com/questions/14824163/how-to-get-the-input-from-the-tkinter-text-box-widget) – Ethan Field Sep 11 '17 at 08:53

0 Answers0