(obtained by holding the shift key and pressing )pyautogui keydown('shift')pyautogui press(' ')pyautogui keyup('shift'this line presses down shiftpresses (and releases and then releases shift if you need to type string into text fieldthe write(function is more suitable but for applications that take single-key commandsthe press(function is the simpler approach hotkey combinations hotkey or shortcut is combination of keypresses to invoke some application function the common hotkey for copying selection is ctrl- (on windows and linuxor - (on macosthe user presses and holds the ctrl keythen presses the keyand then releases the and ctrl keys to do this with pyautogui' keydown(and keyup(functionsyou would have to enter the followingpyautogui keydown('ctrl'pyautogui keydown(' 'pyautogui keyup(' 'pyautogui keyup('ctrl'this is rather complicated insteaduse the pyautogui hotkey(functionwhich takes multiple keyboard key string argumentspresses them in orderand releases them in the reverse order for the ctrl- examplethe code would simply be as followspyautogui hotkey('ctrl'' 'this function is especially useful for larger hotkey combinations in wordthe ctrl-altshift- hotkey combination displays the style pane instead of making eight different function calls (four keydown(calls and four keyup(calls)you can just call hotkey('ctrl''alt''shift'' 'setting up your gui automation scripts gui automation scripts are great way to automate the boring stuffbut your scripts can also be finicky if window is in the wrong place on desktop or some pop-up appears unexpectedlyyour script could be clicking on the wrong things on the screen here are some tips for setting up your gui automation scripts use the same screen resolution each time you run the script so that the position of windows doesn' change the application window that your script clicks should be maximized so that its buttons and menus are in the same place each time you run the script