Before we dive into the complete code for this chapter, we have one last introductory component to discuss. So far in this book, we have used only the .py
extension for the scripts we have developed. This, however, is not the only available extension for Python scripts. Another extension, and the one we use with this script, is .pyw
, which instructs Python to not launch a command window with our script.
Depending on how you executed the script, you may have noticed that Python scripts require a command window when executed to display print statements, errors, and more. With this new extension, this window will not appear and we will not be able to view these messages or any output. This mode is designed to allow graphic applications to run in Python without the background command window or for scripts, like ours, that do not require a command window for operation. Here we will use it with a more malicious goal in mind.