with tempfile.NamedTemporaryFile(delete=False) as f:
    f.write('\n'.join(inbuff).encode('utf-8'))
p = Popen(['/path/to/myapp', '-i', f.name], stdout=PIPE)
outbuff, conditionbuff = [], []
for line in iter(p.stdout.readline, ''):
    line = line.strip().decode('utf-8')
if 'condition' in line:
    conditionbuff.append(line)
else:
    outbuff.append(line)
p.stdout.close()
p.wait()
os.remove(f.name)
Can you open stdin as a file on MS Windows in Python?