Sublime Forum

Problems Turtle turtle.onscreenclick

#1

Hi all, I am a newbie here and probably this is a stupid question but I’m stuck with it:(
The script below runs like a charm from IDLE but NOT from Sublime 3.
I couldn’t even get a Turtle graphics window active, just a “splash”.
Do I need to install smth extra?
TIA

#ClickSpiral.py
import random
import turtle
t = turtle.Pen()
t.speed(0)
turtle.bgcolor(“black”)
colors = [“red”, “yellow”, “blue”, “green”, “orange”, “purple”, “white”, “gray”]
def spiral(x,y):
t.pencolor(random.choice(colors))
size = random.randint(10,40)
t.penup()
t.setpos(x,y)
t.pendown()
for m in range(size):
t.forward(m*2)
t.left(91)
turtle.onscreenclick(spiral)

0 Likes

#2

possibly related:

0 Likes