Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is '#!/usr/bin/python' in front of every Python script a must? [duplicate]

Tags:

Possible Duplicate:
Why do people write #!/usr/bin/env python on the first line of a Python script?
What does the line “#!/bin/sh” mean in a UNIX shell script?

It's a comment and should be ignored by the interpreter. Why is #!/usr/bin/python still in almost every program?

like image 363
NoobDev4iPhone Avatar asked Mar 28 '12 04:03

NoobDev4iPhone


People also ask

What are the meanings of is?

Definition of is (Entry 1 of 4) present tense third-person singular of be. dialectal present tense first-person and third-person singular of be. dialectal present tense plural of be.

What type of word is is?

Is is what is known as a state of being verb. State of being verbs do not express any specific activity or action but instead describe existence. The most common state of being verb is to be, along with its conjugations (is, am, are, was, were, being, been). As we can see, is is a conjugation of the verb be.

Is in use a word?

Definition of in use : being used All of the computers are currently in use.

What grammar is the word is?

The word “is” is always used as a verb in written and spoken English. This word is considered as a verb because it expresses existence or a state of being. It is classified under linking verbs and is a derivative of the verb “to be.” In the sample sentence: He is the most intelligent student in class.


1 Answers

If the script is made executable, the operating system will use that first line to know which interpreter to run to parse the rest of the file to perform some action.

If you always run these kinds of scripts from the command line like python foo.py then you could remove the first line.

like image 78
iandouglas Avatar answered Sep 26 '22 19:09

iandouglas