How to run pyautogui script in full screen under mac?

because automation does not require the best software windows or browsers to be fixed in size, after I have written the python script, I want to test it and find that after one window of mac is maximized, the window running the script is assigned to another desktop. How does my python script automate some operations on the current window?

Mar.20,2021
Menu