TAB Key in Python
Question: I'm working on a Python application that asks the user for two inputs, but in
order for them to go to the next input, they need to hit ENTER/RETURN, is it
possible to also use the TAB key?

Right now, if the user hits TAB, it'll just add a space to the text.

[EDIT] I did try the sys.stdin method but all I get is a blank screen.


Answer: As stated [here](http://stackoverflow.com/questions/19084223/python-raw-input-
use-tab-instead-of-enter), if you use `raw_input` or `input` it is not
possible and you would have to read from `stdin` directly

    
    
    import sys
    
    
    def input_with_tab():
        text = ""
        while True:
            char = sys.stdin.read(1)  # read 1 character from stdin
            if char == '\t':  # if a tab was read
                break
            text += char
    
        return text
    
    print("Write something:")
    text = input_with_tab()
    print(text)
    

