Python error "AttributeError: '_Screen' object has no attribute 'mainloop'" python module turtle

0 votes

I'm trying to build the snake game using python turtle module. I am stuck at this error:

AttributeError: '_Screen' object has no attribute 'mainloop'

As of now I've only set a screen and trying to test if that works.

Code:

import turtle

#set up the screen
wn = turtle.Screen()
wn.title("snake game")
wn.bgcolor("Blue")
wn.setup(width=600, height=600)
wn.tracer(0)


wn.mainloop()
Jun 19, 2019 in Python by Nagya
1,723 views

1 answer to this question.

0 votes

Hey @Nagya, replace 

wn.mainlopp()

with

turtle.mainloop()

and it should work

answered Jun 19, 2019 by Faiza
Thanks @Faiza, That worked

Related Questions In Python

0 votes
1 answer

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

Instead of  wn.onkeypress(go_up, "w") Try wn.onkey(go_uo, " ...READ MORE

answered Jul 4, 2019 in Python by Pooja
1,428 views
0 votes
1 answer

Getting AttributeError: 'module' object (scipy) has no attribute 'misc' in Python. How to solve this?

>>> import scipy >>> scipy.misc Traceback (most recent call ...READ MORE

answered Dec 24, 2018 in Python by Nymeria
• 3,520 points
4,314 views
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, 2019 in Python by Shri
46,730 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, 2019 in Python by Yesha
3,219 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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,465 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,094 views
+1 vote
2 answers

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, 2019 in Python by Faiza
9,107 views