import sys, select

#https://docs.python.org/3/library/sys.html
#https://docs.python.org/3/library/select.html

#say something
print("PICO READY to times your whole number by two")
print("what is your number?")

#set up our input method 
poll = select.poll()
poll.register(sys.stdin, select.POLLIN)
buf = ""

while True:
    
    if poll.poll(0):
        ch = sys.stdin.read(1)
        if ch:
            if ch == "\n":
                line = buf.strip()
                buf = ""
                if not line:
                    continue

                try:
                    print("You said: ",line," two times that is ",(int(line)*2))  
                except Exception as e:
                    print("ERROR", e, ". You Wrote: ", line, "which means you didn't give me a whole number")
            else:
                buf += ch
time.sleep(0.005)