The code is:
import random
import time
import pyautogui as pag
print("The program has initiated!")
print("To stop the program, just close it")
while True:
x = random.randint(600,800)
y = random.randint(200,600)
pag.moveTo(x,y,0.5)
time.sleep(3)
When I run this in PyCharm it works normally, but when I run the source file by double clicking it, it just opens terminal and immediately closes.
i also have a few other projects that also dont work when i double click them. they use pygame and tkinter and the app window isnt opening
I tried changing the file type to .txt file and back to .py file, still just opens terminal and immediately close
afterwards i tried opening a cmd in the file’s folder and run it through that which worked but i want it so i can just run the file and have it work