fw isactive returns true if window is the active window true fw maximize(maximizes the window fw ismaximized true fw restore(undoes minimize/maximize action fw minimize(minimizes the window import time wait seconds while you activate different windowtime sleep( )fw activate(fw close(this will close the window you're typing in the ismaximized uisminimized vand isactive attributes contain boolean values that indicate whether the window is currently in that state the maximize(xminimize(zactivate({and restore( methods change the window' state after you maximize or minimize the window with maximize(or minimize()the restore(method will restore the window to its former size and position the close(method will close window be careful with this methodas it may bypass any message dialogs asking you to save your work before quitting the application the complete documentation for pyautogui' window-controlling feature can be found at features separately from pyautogui with the pygetwindow moduledocumented at controlling the keyboard pyautogui also has functions for sending virtual keypresses to your computerwhich enables you to fill out forms or enter text into applications sending string from the keyboard the pyautogui write(function sends virtual keypresses to the computer what these keypresses do depends on what window is active and what text field has focus you may want to first send mouse click to the text field you want in order to ensure that it has focus as simple examplelet' use python to automatically type the words helloworldinto file editor window firstopen new file editor window and position it in the upper-left corner of your screen so that pyautogui will click in the right place to bring it into focus nextenter the following into the interactive shellpyautogui click( )pyautogui write('helloworld!'notice how placing two commands on the same lineseparated by semicolonkeeps the interactive shell from prompting you for input between running the two instructions this prevents you from controlling the keyboard and mouse with gui automation