So I'm starting out with tkinter (8.6.7) for the first time, installed via conda unto one of my environments with python 3.5.4 on it, and for some reasons it just keeps crashing my jupyter notebook. This is the simple code I use,
from tkinter import filedialog
from tkinter import *
root = Tk()
root.filename = filedialog.askopenfilename(initialdir = "/",title = "Select file",filetypes = (("jpeg files","*.jpg"),("all files","*.*")))
and as soon as I exit the dialog window that gets opened using Finder (I'm on a mac), my kernel crashes and restarts, even if I pick no files and just press cancel.
Does anyone have any idea why this keeps happening? My environment is up to date, and can use numpy, for ex., with no problems.
I replicated your problem. Using the %%python magic solved if for me. Try this: