0

I just started to learn python and trying to write simple chat using select. I run Windows.

. In my client i use

socket_list=[]
    socket_list.append(sys.stdin)
    socket_list.append(s)
    while 1:


        # Get the list sockets which are readable
        read_sockets,wr,err = select.select(socket_list , [], [])

Because i run windows i cannot add sys.stdin to socket_list. Anyone can suggest different way how i can do this?

Thank you very much and sorry for noob questions.

Farseer
  • 4,036
  • 3
  • 42
  • 61
  • Possible duplicate of [Using sys.stdin in select.select on Windows](http://stackoverflow.com/questions/12499523/using-sys-stdin-in-select-select-on-windows?rq=1) – torek Aug 10 '13 at 21:00

1 Answers1

0

you can use input() instead of sys.stdin but when you type an 's' and Enter is "s\r".

So if

s1=input() #type s as input
s1!='s' # so it is 's\r'
Madan Ram
  • 880
  • 1
  • 11
  • 18