Python Forum
Is the #! (shebang) line obsolete?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is the #! (shebang) line obsolete?
#1
Hi!

It looks like the Python language is advancing much much quicker than books on Python, so I find that although some sites explaining python are somewhat behind, a much bigger gap is normally found with books on python, to the point that there is usually a better way to do things in python than what you find in books.

I just saw on a book dealing with python 3, that you need to start a program with a #! (shebang) line which tells your computer that you want Python to execute this program. The shebang line begins with #!, but the rest depends on your operating system:
  • On Windows, the shebang line is #! python3.
  • On OS X, the shebang line is #! /usr/bin/env python3.
  • On Linux, the shebang line is #! /usr/bin/python3.

So, I'm using Python 3.7.4 on a computer running Windows 10, and it seems to me that with or without the shebang line, I have to proceed the same way to run a program, that is to say, I have to click 'Run Module' from the dropdown menu 'Run' on the IDLE environment.

That makes arise some questions:

1) What does the #! (shebang) line exactly do?
2) Is the #! (shebang) line obsolete?

All the best,
newbieAuggie2019

"That's been one of my mantras - focus and simplicity. Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple. But it's worth it in the end because once you get there, you can move mountains."
Steve Jobs
Reply


Messages In This Thread
Is the #! (shebang) line obsolete? - by newbieAuggie2019 - Oct-29-2019, 09:25 PM
RE: Is the #! (shebang) line obsolete? - by nilamo - Oct-29-2019, 09:39 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020