Chris, I really appreciated your very thoughtful and encouraging message. This will help me learn python and move forward in a more idiomatic way. You rock!! I will spend some time on what you recommend. Looking forward to checking out your work too.
Jay On Monday, 17 February 2020 16:16:59 UTC-6, Chris Barker wrote: > > I think you need to rethink a bit what you are doing here: > > You are calling a python program from within a python program? Why? Do you > need two programs running? > > If you do have a good reason, then you need to rethink how you are using > PyInstaller (and maybe it's not the right tool). > > PyInstaller is designed to make ONE single application out of a pile of > Python code. It sounds like you need two (or more?) applications. In which > case, I think there are ways to make multiple top level programs that share > the same libs, etc. Do a little googling, I can't find it at the moment, > but it is possible, if not well tested. > > -CHB > > > > > > > On Mon, Feb 17, 2020 at 12:29 AM JAY JAY <jayknow...@gmail.com > <javascript:>> wrote: > >> 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 pyins...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/pyinstaller/4aa122fb-a375-4f52-9a6e-a6507dbe695a%40googlegroups.com >> >> <https://groups.google.com/d/msgid/pyinstaller/4aa122fb-a375-4f52-9a6e-a6507dbe695a%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > > > -- > > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > chris...@noaa.gov <javascript:> > -- 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/3f4d9acf-9b22-45a2-956b-d6d89e5a79a3%40googlegroups.com.