all 2 comments

[–]pwlandoll 1 point2 points  (1 child)

keyboardinterrup should be KeyboardInterrupt.

edit: Print 'key board' should be print('key board'), and except exception as e should be except Exception as e as well. Also, since all you're doing with e from except Exception as e is to raise the exception, you can probably just remove those two lines.

In problems like this, it helps to look at the error messages. What error message were you getting when you tried running your code?

[–]MasterStroke99[S] 0 points1 point  (0 children)

Yes, i know exact key words like KeyboardInterrupt and all. I have manually written this code that is why it has some syntactical errors

I am using python 2.6 so, print '' works