Python error "AttributeError: '_Screen' object has no attribute 'onkeypress'"

0 votes

I'm trying to use the following line in my python code

wn.onkeypress(go_up, "w")

But I end up with the following error:

    wn.onkeypress(go_up, "w")
AttributeError: '_Screen' object has no attribute 'onkeypress'
Jul 4 in Python by Vedant
18 views

1 answer to this question.

0 votes

Instead of 

wn.onkeypress(go_up, "w")

Try

wn.onkey(go_uo, "w")
answered Jul 4 by Pooja

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

Python Pandas error: AttributeError: 'DataFrame' object has no attribute 'rows'

There is no attribute called “rows”. The ...READ MORE

answered Mar 28 in Python by Shri
1,245 views
0 votes
1 answer

Python error "AttributeError: 'Turtle' object has no attribute 'Shape'"

Hey @Nagya, replace python.Shape("Square") with the following: python.shape("square") Python is case ...READ MORE

answered Jun 19 in Python by Faiza
54 views
0 votes
1 answer

Python error "AttributeError: 'str' object has no attribute 'casefold'"

Check your python version. Casefold is possible ...READ MORE

answered Jul 4 in Python by Yesha
47 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 130 views
+4 votes
6 answers
0 votes
1 answer

Python error "ImportError: No module named pygame.locals"

You need to download and install the ...READ MORE

answered Jun 18 in Python by Greg
33 views
0 votes
1 answer

Key error in Python

A KeyError occurs when the Key doesn't ...READ MORE

answered Sep 20, 2018 in Python by SDeb
• 12,360 points
364 views