A PYW is a Python script file that is executed to display the graphical user interface (GUI) of a Python application. It is associated with Python by Python Software Foundation and are executed/run using PythonW instead of Python. When executed, the PYW launches a GUI instead of a DOS console from popping up for displaying the output. Thus, Python actually runs the script in background.
PYW File Format
PYW files are stored as text script files and can be executed with pythonw on Mac, Windows and Linux OS.
What is the difference between Python and Pythonw?
python.exe is associated with . py files and opens and runs in a terminal window. pythonw.exe is associated with . pyw files and does not open the terminal.
The PYW file type is primarily associated with Python by Python Software Foundation. PYW files are used in Windows to indicate a script needs to be run using PYTHONW. EXE instead of PYTHON. EXE in order to prevent a DOS console from popping up to display the output.