part of code:
class A:
def __init__(self,my_arg):
do sth...
def f1(self):
one = (sys.executable, "script.py")
output = subprocess.Popen(one, stdout=subprocess.PIPE)
def f2(self):
do_sth...
class program(tk.Tk):
def __init__(self):
super().__init__()
...
button_run = Button(root)
button_run.configure(command = self.run_program)
root.mainloop()
def run_program(self):
file_list = ['file1','file2']
for file in file_list:
cls_A = A(file)
cls_A.f1()
cls_A.f2()
if __name__== '__main__':
program()
Problem:
I have read many topics about this problem but have not seen any solution. subprocess is blocking Tkinter after conversion to exe, and my program is not running same as from script, after clicking RUN button is creating new tkinter window and again...
I know that this problem is connected with subprocess part, how to run external module same as subprocess do , but diferently?
this solution not working: pyInstaller loads script multiple times
multiprocessingwithin the mainloop? Because that would produce a new window once again for the different process.Ado or make a minimal, reproducible example to try?multiprocessing, you don't have to use that. At least try to mention what kind of operation does it perform. Nothing seems to be suspicious in the current code, except the calls to functions in classA.