AttributeError: module 'curses' has no attribute 'init_scr'

I have been trying to do a keyboard control program in python. Even though the program is not giving any error, it doesn’t give the output as desired.
I have been doing this program in terminal and each time I run the program the cursor is misbehaving and the screen is going grey.
The full code is attached below:

What do you expecting from this program ?? Could you please post the output from the above code ? Next time, please don’t post images of code, post the code using the preformatted text tag, so that we can copy the code to our machine for analysis. You may post the image of the output.

Sorry for the late replay, I just want to print up, down, right or left corresponding to the arrow key pressed. Output:

The problem is with the init_scr() fuction. I think, there is no function named init_scr() in curses. You just replace the init_scr() in your script with initscr() and everything will be fine.

Best of luck!