如果像这样执行,我希望程序做一件事:
cat something | my_program.py
如果像这样跑,做另一件事
my_program.py
但是如果我从stdin读取,那么它将等待用户输入,所以我想在尝试从stdin读取之前看看是否有任何东西要读.
python
python ×1