Go to advanced search

by keattisak
Wed Nov 16, 2016 3:08 am
Forum: Python
Topic: select.select( [sys.stdin], [], [], 10 ) does not work
Replies: 2
Views: 1909

Re: select.select( [sys.stdin], [], [], 10 ) does not work

Running from rc.local means the stdin isn't connected to anything. My guess is that in this case the select returns immediately with sys.stdin in 'e' and nothing in 'i' and 'o'. Your output is likely to be lost too as stdout won't be connected to anything either. Thank you for your reply. I dont kn...
by keattisak
Tue Nov 15, 2016 12:48 pm
Forum: Python
Topic: select.select( [sys.stdin], [], [], 10 ) does not work
Replies: 2
Views: 1909

select.select( [sys.stdin], [], [], 10 ) does not work

Hello everyone, The following is the famous python code for checkin hitting of keyboard. import sys, select print "You have ten seconds to answer!" i, o, e = select.select( [sys.stdin], [], [], 10 ) if (i): print "You said", sys.stdin.readline().strip() else: print "You said nothing!" I boot up my P...

Go to advanced search