threading and raw input do not work together unless have something nowait/non blocking.
I advise to take a look at Gevent module.
Next time also unscramble your code, so we can see what your trying to do.
You can always leave the "security" parts out so long you put some pseudo example...or we can not help you.