Problems with running turtle programs in Spyder
See original GitHub issueDescription
when i try to launch a script using turtle the turtle graphics window is not working. What steps will reproduce the problem?
- write a script like:
import turtle
wn=turtle.Screen()
wn.bgcolor("lightgreen")
tess = turtle.Turtle() # Create tess and set some attributes
tess.color("hotpink")
tess.pensize(5)
alex = turtle.Turtle() # Create alex
tess.forward(80) # Make tess draw equilateral triangle
tess.left(120)
tess.forward(80)
tess.left(120)
tess.forward(80)
tess.left(120) # Complete the triangle
turtle.done()
- launch it
What is the expected output? What do you see instead? The graphic window opens up but it doesn’t produce the output because it stops saying it is not working
Version and main components
- Spyder Version: 3.2.4
- Python Version: 3.6.3
- Qt Versions: 5.6.2, PyQt5 5.6 on Windows
Dependencies
pyflakes >=0.6.0 : 1.6.0 (OK)
pycodestyle >=2.3: 2.3.1 (OK)
pygments >=2.0 : 2.2.0 (OK)
pandas >=0.13.1 : 0.20.3 (OK)
numpy >=1.7 : 1.13.3 (OK)
sphinx >=0.6.6 : 1.6.3 (OK)
rope >=0.9.4 : 0.10.5 (OK)
jedi >=0.9.0 : 0.10.2 (OK)
nbconvert >=4.0 : 5.3.1 (OK)
sympy >=0.7.3 : 1.1.1 (OK)
cython >=0.21 : 0.26.1 (OK)
qtconsole >=4.2.0: 4.3.1 (OK)
IPython >=4.0 : 6.1.0 (OK)
pylint >=0.25 : 1.7.4 (OK)
Issue Analytics
- State:
- Created 6 years ago
- Comments:33 (20 by maintainers)
Top Results From Across the Web
Turtle Graphics Not Responding - python - Stack Overflow
I'm using python 3.6.0 and ran into the same issue. The turtle.done() after your code block prevents the turtle graphic window from becoming...
Read more >Turtle Programming in Python - GeeksforGeeks
Turtle Programming in Python · Import the turtle module · Create a turtle to control. · Draw around using the turtle methods. ·...
Read more >5.9. Common turtle Errors - Runestone Academy
Below we'll describe common errors that beginning programmers encounter when writing turtle code. Some of these errors can be applied to other instances...
Read more >3. Hello, little turtles! — How to Think Like a Computer Scientist
Let's write a couple of lines of Python program to create a new turtle and start ... a turtle script in Spyder, make...
Read more >What is Python Turtle used for? - Educative.io
turtle is a pre-installed Python library that allows users to create pictures ... When we run these commands, the turtle will turn right...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ccordoba12 testing a little bit with
Turtle
I came with some tips to run a script multiple times in Spyder or prevent the crash of the IPython kernel when trying to run a script that usesTurtle
(at least on Windows):turtle.done()
withturtle.bye()
and use theInline
orAutomatic
backend for the IPython Console (Preferences
>IPython Console
>Graphics
>Graphics Backend
). As an example:The call of
turtle.bye()
will raise aTerminator
error but the IPython kernel will not die. To prevent the output of the exception you can use atry-except
:The reason for this is to clean some elements used by
Turtle
after running.Run
>Configuration per file...
> SelectExecute in an external system terminal
over theConsole
section.I really don’t know what happens and we don’t have time to help you debug it, sorry.