How to write native newline character to a file descriptor in Python? May 16, 2023 by Tarik Use this import os os.write(fd, os.linesep)