import os import time with open("testfifo", "r") as f: print(f.read()) pipefd = os.open("./testfifo", os.O_RDWR) print(pipefd) piper = os.fdopen(pipefd, "rb") pipew = os.fdopen(pipefd, "wb") pipew.write(b"rw test") print(piper.read()) pipew.write(b"aaaaaaaaaaaaaa") time.sleep(10) print("exiting")