
Daniel U. answered 04/30/19
Professional Software Developer and PhD Here To Help
This shebang line allows people to run the script without prepending the Python executable. For example, you can run "./myprogram.py" instead of "python3 ./myprogram.py".
The "/usr/bin/env python" causes the running user's default Python installation to run the program. In some uncommon situations, you might find something like this "#!/local/bin/python2.7" on a real world system where a very specific Python installation is required. It's definitely not ideal, but you can point to a specific Python installation, as opposed to the user's default Python installation, by using a modified shebang line.