Unable to run a thread in background
===

I am writing a Python code where in I have to make a thread which will scan a data line for data exchanges. A new thread will be spawned whenever a device of the specified type is attached to the data network. This new thread will filter all the data exchanges that has the device either in the sender or the receiver part of the communication packet.
The problem is that I am using the first thread as daemon, but whenever there is a blocking statement like an input from a user to store the data from the second thread or flush it, the daemon thread stops.