title: Pattern matching Tkinter child widgets (winfo_children) to determine type
body: <p>I'm trying to automatically clear all <code>Entry</code> widgets in a parent widget.</p>
  
  <pre><code>import Tkinter
  import re
  root=Tkinter.Tk()
  
  E1=Tkinter.Entry(root)
  E1.pack()
  
  E2=Tkinter.Entry(root)
  E2.pack()
  
  L1=Tkinter.Label(root,text='Label1')
  L1.pack()
  </code></pre>
  
  <p>I'm running into 3 problems</p>
  
  <ol>
  <li>While I can find out the children widget type, I can't seem to be able to use it in a pattern match. Printing out the <code>wlist[0]</code> below is different from the shell output?  </li>
  </ol>
  
  <p>Eg:</p>
  
  <pre class="lang-none prettyprint-override"><code>&gt;&gt; wlist=root.winfo_children()
  &gt;&gt; wlist
  [&lt;Tkinter.Entry instance at 0x00000000151911C8&gt;,
   &lt;Tkinter.Entry instance at 0x00000000151BAD88&gt;,
   &lt;Tkinter.Label instance at 0x00000000151B29C8&gt;]
  
  &gt;&gt; wlist[0]    # shell output
  &lt;Tkinter.Entry instance at 0x00000000151911C8&gt;
  
  &gt;&gt; print wlist[0]   # print output here is different vs shell output above
  .353964488L
  </code></pre>
  
  <ol start="2">
  <li>I think due to the differences between the print output &amp; shell output above, my pattern match can't work?</li>
  </ol>
  
  <p>Eg</p>
  
  <pre><code>&gt;&gt; re.search(r'Entry',wlist[0])
      &lt;&lt; No output &gt;&gt;
  </code></pre>
  
  <ol start="3">
  <li>Assuming one is able to determine via pattern match that a child widget is indeed an <code>Entry</code> widget, how would you get the widget object itself to perform a <code>delete</code> method call?</li>
  </ol>
  
  <p>Eg:</p>
  
  <pre><code>## Assuming I have a function to to clear the entry
  ## How would I pass the object from the pattern match in #2 to this function?
  def clear_entry(objEntry):
      objEntry.delete(0,Tkinter.END)
  </code></pre>