I want to make a program using Python Turtle, that moves the turtle to mouse coordinates while clicking. But I don't know how to write a function that returns mouse position. Or, if it will be more understandable, there is HTML and JavaScript code to convert into Python code:
function getcoords(event)
{
console.log(event.clientX + " " + event.clientY);
}
addEventListener("click", getcoords)
The Python logic is pretty much the same as your Javascript logic:
from turtle import Screen
def getcoords(x, y):
print(x, y)
screen = Screen()
screen.onclick(getcoords)
screen.mainloop()