I wrote a program, that shows a terminal UI with python curses. The program shall be able to read from STDIN and write the result after the user interaction to STDOUT w/o so the output may be redirected to another program or file like so:
cat in.csv | my_tool > out.csv
I figured out a working solution for STDIN to not interfere with curses (Linux: Pipe into Python (ncurses) script, stdin and termios).
I also found several solutions to redirect STDOUT temporarily to a file (Redirect stdout to a file in Python?)
If I read this right, it is possible in C. But the newterm function is not exposed in the python wrapper?