I'm trying to compile my tcountdown.py
into a .exe
file with pyinstaller
. I've read some manuals and watched YouTube tutorials about it and all saying the same (which I did): [cmd: c:/**/*>pyinstaller --onefile -w -F tcountdown.py]
. cmd has the same path as the .py's and it compiles a .exe file. But when I run tcountdown.exe
it doesn't start tpopup. When I run tcountdown.py
with cmd everything works well. I also compiled only tpopup into a .exe to check if something's wrong with that but this is also working without issues.
tcountdown.py:
import os
import time
time.sleep(10)
os.system('tpopup.py')
mainspript: tcountdown.py
secondary script: tpopup.py
Python version is 3.9.1
I think you need to edit tpopup.py so that it has the setup of whatever you need to do for setup like you had:
# your setup code goes where it was here
Then, put the rest of the code into a function, say for example:
def open_popup(maybe_with_arguments):
# rest of the code here
And then in tcountdown, you can use
import tpopup # with import, you don't need to compile tpopup - you just need to make sure it's in the same directory as tcountdown.py and pyinstaller should notice it and pack it into the .exe
import time
time.sleep(10) # waiting
tpopup.open_popup(possible_arguments) # calls the code that actually calls the popup, opening the popup AFTER the wait has been completed.