How do I make this a non-blocking call? osd_cat accepts input only as a PIPE which need p.communicate() call making the process to block. Is there any other way to set stdin in Popen?
p = subprocess.Popen(('osd_cat',
'-d',
'{}'.format(interval)),
stdin=subprocess.PIPE)
p.communicate(message)
stdin? Have you triedp.stdin.write()before asking the question? (Yes, you'll want to do that in a separate thread to prevent blocking in the main process, but this is part of what threads are good for).