Skip to main content
7 of 9
Some popular Linux distributions have now moved to using Python 3 as the default `python`, so the "Python 2" distinction is incorrect.
Mateen Ulhaq
  • 27.8k
  • 21
  • 121
  • 155

Why do people write #!/usr/bin/env python on the first line of a Python script?

I see these at the top of Python files:

#!/usr/bin/env python
#!/usr/bin/env python3

It seems to me like the files run the same without that line.

john garcias
  • 14k
  • 3
  • 18
  • 3