在树莓派中调用select

时间:2014-12-10 10:43:45

标签: python raspberry-pi

每当我在raspberry pi上运行此代码时,我得到的错误消息是我的参数... TypeError:参数必须是int,或者有一个fileno()方法。

input = [sys.stdin]
while(1):
        try:
              inputready, _, _ = select.select(input,[],[], 10)   

        except Exception as e:
              print(e); break  

1 个答案:

答案 0 :(得分:0)

一切顺利:

user@raspberrypi ~/src $ cat /etc/issue
Raspbian GNU/Linux 7 \n \l
user@raspberrypi ~/src $ python --version
Python 2.7.3
user@raspberrypi ~/src $ cat check_select.sh 
import sys,select
input = [sys.stdin]
while(1):
        try:
              inputready, _, _ = select.select(input,[],[], 10)   

        except Exception as e:
              print(e); break 
user@raspberrypi ~/src $ python !$
python check_select.sh
adsfdsf