tkinter debugging with Spyder
<p>I am using tkinter to build a GUI app with anaconda python and spyder on OSX. I can't get a prompt in the ipython console while my tkinter window is open.  I can set a breakpoint and get into the debugger, but after that Spyder will shortly freeze or crash. </p>

<p>Here is sample code that fails: </p>

<pre><code>from tkinter import *

def toggle():
    i = 1
    b = 2
    print(i, b)
    pass

root = Tk()
frame = Frame(root, width=100, height=100)
button = Button(frame,text="Press", command=toggle).grid(column=1, row=1)
frame.pack()
root.mainloop()
</code></pre>

<p>I run the debugger and set a breakpoint in the toggle() function.  At the ipdb> prompt I can get the state of frame but nothing for button as below:</p>

<pre><code>ipdb&gt; frame
&lt;tkinter.Frame object .4709317264&gt;

ipdb&gt; button
</code></pre>

<p>I click on the button in the tkinter window and back to the ipdb> prompt and soon spyder crashes. </p>

<p>Question 1:  Can this be fixed?
Question 2:  Is there a way to get a Spyder ipython console and variable explorer pane to function when a tkinter window open?</p>