I'm writing a script for automatizing some tasks at my job. However, I need to make my script portable and try it on different screen resolution. 
So far right now I've tried to multiply my coordinate with the ratio between the old and new resolutions, but this doesn't work properly.
Do you know how I can convert my X, Y coordinates for mouse's clicks make it works on different resolution?
Quick question: Are you trying to get it to click on certain buttons? (i.e. buttons that look the same on every computer you plug it into) And by portable, do you mean on a thumb drive (usb)?
You may be able to take an image of the button (i.e. cropping a screenshot), pass it on to the opencv module, one of the modules has an Image within Image searching ability. you can pass that image along with a screenshot (using pyautogui.screenshot()) and it will return the (x,y) coordinates of the button, pass that on to pyautogui.moveto(x,y) and pyautogui.click(), it might be able to work. you might have to describe the action you are trying to get Pyautogui to do a little better.
Pyautogui mouse click on different resolution