pipe_name = 'pipe_test'
if not os.path.exists(pipe_name):
    os.mkfifo(pipe_name)
print('Waiting for server to start...')
with open(pipe_name, 'w') as pipe:
    action = eval(input('Enter action to send: '))
pipe.write(action + '\n')
Interprogram communication in python on Linux