I'm really puzzled by this, but the answer is probably quite simple and just can't see it:
I have a series of python modules that work fine from within the python interpreter, but nothing happens when running from a GUI situation. I've tried creating a .desktop file, adding shebangs, changing permissions to 777 and renaming to
.pyw for all the modules. A single test module works fine on its own, so I know that it's not a typo error.
If I click the main module
.pyw file and click 'Run' from the system dialogue nothing happens at all. Similarly the
.py file (and the
.desktop via menu), nothing happens. Here is the start of my code:
#!/usr/bin/python3 import tkinter as tk, imp, sys root = tk.Tk() msg = tk.messagebox sdg = tk.simpledialog import capitaliser_cfg as cfg, fileio as io imp.reload(cfg) ; imp.reload(io) ### GO AND GET COUNTY LIST #### # Nb: attach to config for simplicity cfg.counties = io.getfilelist("counties.txt", "London") if not type(cfg.counties)==list: k = msg.showerror(cfg.version, cfg.counties) root.destroy() root.mainloop() ### GO AND GET DICTIONARY #### cfg.tempdict = [,,] cfg.spelldict = io.getdictionary("addressdict.txt","roda","Road") if not type(cfg.spelldict)==dict: k = msg.showerror(cfg.version, cfg.spelldict) root.destroy() root.mainloop() import thinbutton as tb, labelradio as lr, fieldblock as fb, bigbutton as bb import textblock as tx, padding as pd, widget_tools as wt import capitaliser_mth as mth import capitaliser_bnd as bnd imp.reload(tb) ; imp.reload(lr) ; imp.reload(fb) ; imp.reload(bb) imp.reload(tx) ; imp.reload(pd) ; imp.reload(wt) ; imp.reload(mth) imp.reload(bnd)
put k = msg.showerror("xxxx","yyyy") after the line
sdg = tk.simpledialog, stil nothing happens which leads me to believe that tkinter is not loading for some reason.
Any ideas anyone ?