PythonのPyAutoGUIでマウスの座標を取得する

>>> import pyautogui
>>> pos = pyautogui.position()
>>> pos
Point(x=229, y=342)
>>> type(pos)
<class 'pyautogui.Point'>
>>> pos[0]
229
>>> pos[1]
342
>>> pos.x
229
>>> pos.y
342