A programmer tries to execute the Python program hello.py as shown, but an error results. What causes this error?
hello.py
An executable Python source file needs a shebang that identifies the Python interpreter, such as #!/usr/bin/python or #!/usr/bin/env python3, when it is run directly as ./hello.py. Without one, the operating system does not know to launch Python and may attempt to process the source as a shell command instead.
#!/usr/bin/python
#!/usr/bin/env python3
./hello.py
Community Discussion