I managed to figure out what was the problem.In fact I am putting the program on hold waiting for nothing and then I am making the thread wait also, so the program crashes. So long story short, what should be done is remove the two lines
ps.wait()
t.join()
and then it will work properly and you may also retrieve answers in real time !