So I've found a way to read from stdin in python, which is as follows:
if not sys.stdin.isatty():
stdin = sys.stdin.read()
but for a statement like this,
echo Hello | program.py
I only get stdin = Hello, which is how it should work. My question is, is there a way to get the whole command as a string in the python program, for example, getting "echo Hello" in the previous exmaple?
Any alternative to get the command in program.py will work too. Thanks :)
Haven't got a good idea yet, so have not tried anything as of yet.