Using select([sys.stdin]) on windows xp

John Taylor john_taylor_1973 at yahoo.com
Wed Oct 6 10:56:38 EDT 2004


I am using some jabber code that uses this:
while(1):
    inputs, outputs, errors = select.select([sys.stdin], [], [],1)

    if sys.stdin in inputs:
        doCmd(con,sys.stdin.readline())
    else:
        con.process(1)

However, I get this error:
select.error: (10038, 'An operation was attempted on something that is
not a socket')

According the the Python docs:
On Windows, the underlying select() function is provided by the
WinSock library, and does not handle file desciptors that don't
originate from WinSock.

So I was wondering how I can change the code above to run on windows
xp.  Any help would greatly appreciated.

Thanks,
-John



More information about the Python-list mailing list