title: How to read the input(line by line) from a multiline Tkinter Textbox in Python?
body: <p>By Using Procedural Programming Paradigm in Python, I have a written a program which reads the input of a file(say File.txt) line by line and print it. Below is the Example:</p>
  
  <p><strong>Script:</strong></p>
  
  <pre><code>import fileinput
  for line in fileinput.input(r'D:\File.txt'):
      line = line.replace(" ", "")
      line = line[0:-1]
      print(line)
  </code></pre>
  
  <p><strong>Result:</strong></p>
  
  <p>Note: If for example "File.txt" contains 2 lines, First line as 'line1' and Second line as 'line2', then output is:</p>
  
  <pre><code>line1
  line2
  </code></pre>
  
  <p>Same Result I want through Object Oriented programing Paradigm by using "Tkinter Multiline TextBox" instead of a file(here in above example File.txt).</p>
  
  <p>I have the Below Code that creates a MultiLine Tkinter TextBox:</p>
  
  <pre><code>import tkinter as tki # Tkinter -&gt; tkinter in Python3
  class App(object):
  
      def __init__(self):
          self.root = tki.Tk()
  
      # create a Frame for the Text and Scrollbar
          txt_frm = tki.Frame(self.root, width=200, height=200)
          txt_frm.pack(fill="both", expand=True)
  
          # ensure a consistent GUI size
          txt_frm.grid_propagate(False)
  
          # implement stretchability
          txt_frm.grid_rowconfigure(0, weight=1)
          txt_frm.grid_columnconfigure(0, weight=1)
  
      # create a Text widget
          self.txt = tki.Text(txt_frm, borderwidth=3, relief="sunken")
          self.txt.config(font=("consolas", 12), undo=True, wrap='word')
          self.txt.grid(row=0, column=0, sticky="nsew", padx=2, pady=2)
  
      # create a Scrollbar and associate it with txt
          scrollb = tki.Scrollbar(txt_frm, command=self.txt.yview)
          scrollb.grid(row=0, column=1, sticky='nsew')
          self.txt['yscrollcommand'] = scrollb.set
  
      def retrieve_input():
          input = self.txt.get("0.0",END)
          print(input)
  app = App()
  app.root.mainloop()
  app.retrieve_input()
  </code></pre>
  
  <p>Now My Problem is, once I run the above code a "Tkinter Multiline TextBox" is coming and I am entering 4 Lines in the Tkinter TextBox as:</p>
  
  <pre><code>ABC
  XYZ
  PQR
  QAZ
  </code></pre>
  
  <p>But I am not getting the Exact Idea/Implementation that How I can read those lines form Tkinter TextBox one by one and Use them for further processing in My Program.</p>
  
  <p>Python Version I am using is 3.0.1.
  Please Help...</p>