---
# System prepended metadata

title: 顯示滑鼠點擊的位置

---

# 顯示滑鼠點擊的位置
```
# ch31_21.py
import turtle
def printStr(x,y): print(f'({int(x)},{int(y)})',end=' ')
t = turtle.Pen()
t.screen.onclick(printStr)
t.screen.mainloop()
```