Cody Bable

Generation

generate functionFri, 28 Apr 2023

create a function to copy turtle coordinates from user mouse clicks on the screen

import turtle def get_coordinates(screen): screen.clear() coord_list = [] screen.onscreenclick(coord_list.append) screen.listen() screen.mainloop() return coord_list turtle.Screen() coord_list = get_coordinates(turtle.Screen())

Questions about programming?Chat with your personal AI assistant