-2

Complete newb here.

What exactly is this line "#!/usr/bin/" I see at the top of every.py file in all of the tutorials? I assume it's the location of that particular file? I don't understand the purpose of it.

Are those lines required? I assume not since there's a # in front of it which means it's a comment?

david
  • 4,447
  • 7
  • 36
  • 74

1 Answers1

3

That's a special line called a "shebang" line. It tells the system what executable to run the file with.

And no, they are not necessary if you specify the executable before the filename when running it. However, if you don't do that, then they are. That means it is best practice to include them.