title: Getting the parent of a parent widget in Python Tkinter
body: <p>I am trying to get the parent of a widget then get the parent of that widget. But Everytime I try to I get a error.</p>
  
  <p>Error:</p>
  
  <pre><code>AttributeError: 'str' object has no attribute '_nametowidget'
  </code></pre>
  
  <p>Why is it giving me that error. Can someone explain to me why I am getting this error and help me to fix it?</p>
  
  <p>Code:</p>
  
  <pre><code>parent = event.widget.winfo_parent()
  parentName = event.widget._nametowidget(parent)
  
  frameParent = parentName.winfo_parent()
  frameParentName = frameParent._nametowidget(frameParent)
  </code></pre>