the code is:
import pyautogui
pyautogui.moveTo(502, 632)
input()
it works in IDLE but when i save and run it, the screen flashes and closes. I tried reading it and it said error in line 1. Please Help.
I found the solution, the thing is i had Anaconda distribution of python installed. Idle was installed in normal python while the when i executed it as .py, anaconda was running it. I just uninstalled anaconda.