Does anyone have a link to a guide on how to write Python or node or rust programs that behave well with bash? Ie. Streaming inputs and outputs and other things I probably don’t know about?
1. Stdin - just iterate through sys.stdin
2. Stdout - regular printing will go there
3. Stderr - print errors here eg with print(…, file=sys.stderr)
And then beyond that as long as your script gets invoked by the interpreter (Ie #!/usr/bin/env python) everything will “just work”.
Not saying it’s hard but also it’s not 100% covered by what you said.
Generally, Python does the right thing by default for scripting use: line buffered, system encoding, EOF handled naturally by the iterator protocol.
[1] https://datascienceatthecommandline.com/2e/chapter-4-creatin...