Aside from the obvious security issues such a program would represent (and your name and signature are curious in that respect as well), you are basically asking for functionality (i.e., a key logger) I believe to be outside what is offered by Python and/or the API of most operating systems. Perhaps you should take up assembly programming?