I have designed a gui with PYQT4. It has two buttons. One of start button. It starts a start.py file. And another button execute stop.py file that stop start.py pid.
This start.py and stop.py files are on a remote location. I am connecting there with ssh and paramiko. 
When I click to start button, gui is freezing and never answering. I can only get rid of the situation by closing the program . I know the problem. Because  there is a while loop in start.py and it never ends. 
When i click to start button its wait for the while loop.
I want to run start.py and i dont want to wait for the loop. It must be run in background or etc.. 
What can i do ? I tried to trigger it with another .py file. I used subprocess method. But no success. Still have same problem.
I found the solution. I covered that function in thread. And now its working properly without freeze or lag.
Qt freezing cause of the loop?