Is there a way to read data that is coming into the command-line, straight into another Python script for execution?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- How to get the return code of a shell script in lu
- Evil ctypes hack in python
Here is an example for future reference and also help others.
Tested with Python 2.6, 2.7, 3.6
You need to read
stdin
from the python script.Sample run -
use pipes
does the magic