Run Background Process in Python

Viewed 82

I know that I can run a background process in python using subprocess. But the problem is that when I make a gui and then use subprocess with close_fds=True parameter, the window changes to not responding.

So, what I want is that I need to create a background process but it should run separately along with the main process and when that process is done, it should again combine with the main process.

BTW, I am using PySide2 as the gui framework

Any help would be appreciated

1 Answers

I think what would be more beneficial to you would be threading, you are able to start a process in another thread without blocking the main thread which runs your gui. Once the other thread has completed its task it will join the main thread

Related