...
icon_img = Tk.PhotoImage(file=icon_fname)
File "/usr/lib/python3.5/tkinter/__init__.py", line 3397, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "/usr/lib/python3.5/tkinter/__init__.py", line 3353, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
RuntimeError: main thread is not in main loop