How to get a TkInter file selection dialogbox to work with IPython / Spyder?
Before running the code above, you need to set the right event loop (in this case Tk
), as you correctly guessed.
To do that you need to run this command:
In [1]: %gui tk
and then run your code.
Note: To access the documentation about the %gui
magic in Spyder, you need to place the cursor in front of %gui
and press Ctrl+I
, like this
In [1]: %gui<Ctrl+I>