Skip to main content
Tried to make it clearer what part of the title was literal.
Source Link
Peter Mortensen
  • 31.5k
  • 22
  • 110
  • 134

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

Why do people write #"#!/usr/bin/env pythonpython" 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 that the files run the same without that line.

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 that the files run the same without that line.

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 that the files run the same without that line.

Fixed grammar in last line (Changed "It seems to me like..." to "It seems to me that...")
Source Link

I see these at the top of Python files:

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

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

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.

I see these at the top of Python files:

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

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

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

I see thisthese at the top of Python files:

  1. For Python 2 files
    #!/usr/bin/env python
    
  2. For Python 3 files
    #!/usr/bin/env python3
    
#!/usr/bin/env python
#!/usr/bin/env python3

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

I see this at the top of Python files:

  1. For Python 2 files
    #!/usr/bin/env python
    
  2. For Python 3 files
    #!/usr/bin/env python3
    

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

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.

add code from title to question body for people to copy-paste easier to their own Python files :)
Source Link
Gabriel Staples
  • 55.8k
  • 34
  • 296
  • 394
Loading
add code from title to question body for people to copy-paste easier to their own Python files :)
Source Link
Gabriel Staples
  • 55.8k
  • 34
  • 296
  • 394
Loading
Rollback to Revision 2
Link
Konrad Rudolph
  • 549k
  • 142
  • 965
  • 1.3k
Loading
add shebang to title
Link
Ciro Santilli OurBigBook.com
  • 391.6k
  • 120
  • 1.3k
  • 1.1k
Loading
Question Protected by CommunityBot
edited body; edited tags; edited title; edited title
Source Link
Sinan Ünür
  • 118.3k
  • 15
  • 201
  • 347
Loading
Source Link
john garcias
  • 14k
  • 3
  • 18
  • 3
Loading