2011-03-29 60 views

回答

6

檢查標準輸入是否爲tty設備。

在SH/bash中:

if [ -t 0 ]; then 

在Python: