title: Display list of text in tkinter
body: <p>I want to display the result of my label encoding in <code>tkinter</code> like I display it using <code>print</code> function in python.</p>
  <pre><code>from sklearn.preprocessing import LabelEncoder
  
  le = LabelEncoder()
  df[&quot;REPORT_FAMILY&quot;] = le.fit_transform(df[&quot;REPORT_FAMILY&quot;])
  print(&quot;Mapping: &quot;)
  for i, item in enumerate(le.classes_):
      print(item, &quot;--&gt;&quot;, i)
  </code></pre>
  <p>This code produce a results like this:</p>
  <pre><code>Mapping: 
  ADELBERT SC3000 --&gt; 0
  ADELBERT SC3020 --&gt; 1
  ALAR --&gt; 2
  ALTER EGO SC460 --&gt; 3
  ALTER EGO SCV360 --&gt; 4
  ARYA --&gt; 5
  BEACHCOMBER --&gt; 6
  </code></pre>
  <p>How I do the same in tkinter?I use the following code but received an error. My target is to display the encoded REPORT_FAMILY column to the respective category in the REPORT_FAMILY.</p>
  <pre><code>import tkinter as tk 
  #creating the window
  window = tk.Tk()
  window.title(&quot;FPY+ Prediction&quot;)
  
  canvas1 = tk.Canvas(window, width = 500, height = 300)
  canvas1.pack()
  
  t = tk.Text(window)
  for i, item in enumerate(le.classes_):
      t.insert(item, &quot;--&gt;&quot;, i)
  t.pack()
  
  window.mainloop()
  </code></pre>
  <p>I receive the following error:</p>
  <pre><code>---------------------------------------------------------------------------
  TclError                                  Traceback (most recent call last)
  &lt;ipython-input-30-6c09ea2a9048&gt; in &lt;module&gt;
       11 canvas1.create_window(200, 300)
       12 for i, item in enumerate(le.classes_):
  ---&gt; 13     t.insert(item, &quot;--&gt;&quot;, i)
       14 t.pack()
       15 
  
  ~\Anaconda3\lib\tkinter\__init__.py in insert(self, index, chars, *args)
     3270         &quot;&quot;&quot;Insert CHARS before the characters at INDEX. An additional
     3271         tag can be given in ARGS. Additional CHARS and tags can follow in ARGS.&quot;&quot;&quot;
  -&gt; 3272         self.tk.call((self._w, 'insert', index, chars) + args)
     3273     def mark_gravity(self, markName, direction=None):
     3274         &quot;&quot;&quot;Change the gravity of a mark MARKNAME to DIRECTION (LEFT or RIGHT).
  
  TclError: bad text index &quot;ADELBERT SC3000&quot;
  </code></pre>