Centrum123 Centrum123 - 1 year ago 71
Python Question

My turtle program in python acts like it has been clicked

import turtle

window = turtle.Screen()

pen = turtle.Turtle()

def star():




I am very new to turtle,and python itself, I am just using some of the documentation that I found on the python website, but when I run this program it runs my function star without the screen even being clicked. The end goal of this program would be for me to click then it would run the function, then if I clicked again the screen would clear and the function would be run again.
Thanks for the help!

Answer Source

You need to pass reference to start function into onscreenclick, and make start to accept two arguments:

def star(x,y):


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download