On Windows, the user would typically run this script via the command line with python scriptname. Once again, the shebang line is required and the script must be executable when running the Python script as an executable script. It also has strange behavior in refusing to search PATH for versioned "python" names such as "python3", while happily searching for "bash". For maximum portability, you should use a shebang that is most likely to work on various systems. The current directory must remain in a CreateProcessW search if the command contains one or more backslashes:.
nest...