HACKER Q&A
📣 memorable

How can I add shell pipeline support to my Python program?


Hi there!

I am currently working a program that allows you to fetch HTML data from a file/raw HTML document input, like this:

   curl https://gohugo.io/ | soup '.title.text'
I have got the program to work as intended on its own, but now I am getting stuck at supporting the pipeline. Does anyone here have any advice or tips for implementing it?

All helps are appreciated!


  👤 majormunky Accepted Answer ✓
I've not done this before, but, in a basic test I think this seemed to work

    import sys
    print(sys.stdin.read())

👤 remram
This seems like a StackOverflow question...