Yeah soo.. I figured out my problem. BONKERS.

Turns out I was using this:

subprocess.call([sys.executable,"file"])

AAAND.. if you run the python script without pyinstaller, sys.executable = the 
python interpreter. In a bundled pyinstaller app, that's NOT WHAT IT IS!!! It's 
actually the executable file itself. So, I was inadvertently running the app 
over and over. I tell you.. that is just nuts. Seriously programmers?

So, I had to figure out another way to execute my py file inside my py script. 
Easy right? Ok, but I needed an argument.. so exec(open(read()) wouldn't work.. 
or would it? Apparently this does:

sys.argv = ["file.py"), vArguments]
exec(open(os.path.join(wd,"tests","errorMessage.py")).read(), globals())

Please note that I also included "globals()" there, because apparently exec 
won't include any imports unless you do that. WTF? I'm... ambivalent about 
Python at the moment. What are all these gotchas??


On Sunday, 16 February 2020 16:23:18 UTC-6, JAY JAY wrote:
>
> I have an app like this
>
> Main.py (includes root and Tk.Toplevel()) -- PythonDataProcessing.py -- 
> tkinterErrorMessage.py (includes another Tk.Toplevel()). 
>
> When I run this on my computer via python main.py, the initial toplevel 
> window opens, and any subsequent error message pulls up toplevel windows as 
> expected. When I put it all through Pyinstaller and run the app, instead of 
> a tkinter toplevel error message, I get initial main.py toplevel window, 
> almost like the program is running itself again. WTF?
>
> I suspect this has to do with hooks in some way? Has anyone run into 
> something like this? Wtf is going on? Like they say.. NOTHING IS EASY!!!!! 
> Thanks for your help!
>

-- 
You received this message because you are subscribed to the Google Groups 
"PyInstaller" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to pyinstaller+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pyinstaller/4aa122fb-a375-4f52-9a6e-a6507dbe695a%40googlegroups.com.

Reply via email to