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


#1

Hello…
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:


#2

Hello,
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.


#3

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


#4

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!