What the line #!/usr/bin/python does? [duplicate]
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
This question already has an answer here:
Why does Python in Linux require the line #!/usr/bin/python?
8 answers
Im learning python but I dont understand what this line does? or how many options there is?
python programming
marked as duplicate by PerlDuck, Rinzwind, PRATAP, Kulfy, user68186 Mar 21 at 16:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Why does Python in Linux require the line #!/usr/bin/python?
8 answers
Im learning python but I dont understand what this line does? or how many options there is?
python programming
marked as duplicate by PerlDuck, Rinzwind, PRATAP, Kulfy, user68186 Mar 21 at 16:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
Why does Python in Linux require the line #!/usr/bin/python?
8 answers
Im learning python but I dont understand what this line does? or how many options there is?
python programming
This question already has an answer here:
Why does Python in Linux require the line #!/usr/bin/python?
8 answers
Im learning python but I dont understand what this line does? or how many options there is?
This question already has an answer here:
Why does Python in Linux require the line #!/usr/bin/python?
8 answers
python programming
python programming
asked Mar 21 at 15:57
Mr.CaringiMr.Caringi
33
33
marked as duplicate by PerlDuck, Rinzwind, PRATAP, Kulfy, user68186 Mar 21 at 16:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by PerlDuck, Rinzwind, PRATAP, Kulfy, user68186 Mar 21 at 16:13
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
This line is called a shebang and it tells the kernel which interpreter to use on the script.
For example, if a script is named with the path path/to/script, and it starts with the line #!/bin/sh, then the program loader is instructed to run the program /bin/sh, passing path/to/script as the first argument.
In your instance, the kernel will use whatever /usr/bin/python points to (I think it is by default python3.6).
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
/usr/bin/pythonshould be Python 2.7. This is per PEP 394, which says the commandpythonshould be Python 2.
– wjandrea
Mar 21 at 16:18
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
This line is called a shebang and it tells the kernel which interpreter to use on the script.
For example, if a script is named with the path path/to/script, and it starts with the line #!/bin/sh, then the program loader is instructed to run the program /bin/sh, passing path/to/script as the first argument.
In your instance, the kernel will use whatever /usr/bin/python points to (I think it is by default python3.6).
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
/usr/bin/pythonshould be Python 2.7. This is per PEP 394, which says the commandpythonshould be Python 2.
– wjandrea
Mar 21 at 16:18
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
add a comment |
This line is called a shebang and it tells the kernel which interpreter to use on the script.
For example, if a script is named with the path path/to/script, and it starts with the line #!/bin/sh, then the program loader is instructed to run the program /bin/sh, passing path/to/script as the first argument.
In your instance, the kernel will use whatever /usr/bin/python points to (I think it is by default python3.6).
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
/usr/bin/pythonshould be Python 2.7. This is per PEP 394, which says the commandpythonshould be Python 2.
– wjandrea
Mar 21 at 16:18
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
add a comment |
This line is called a shebang and it tells the kernel which interpreter to use on the script.
For example, if a script is named with the path path/to/script, and it starts with the line #!/bin/sh, then the program loader is instructed to run the program /bin/sh, passing path/to/script as the first argument.
In your instance, the kernel will use whatever /usr/bin/python points to (I think it is by default python3.6).
This line is called a shebang and it tells the kernel which interpreter to use on the script.
For example, if a script is named with the path path/to/script, and it starts with the line #!/bin/sh, then the program loader is instructed to run the program /bin/sh, passing path/to/script as the first argument.
In your instance, the kernel will use whatever /usr/bin/python points to (I think it is by default python3.6).
edited Mar 21 at 16:12
wjandrea
9,51342765
9,51342765
answered Mar 21 at 16:01
j-moneyj-money
1,370418
1,370418
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
/usr/bin/pythonshould be Python 2.7. This is per PEP 394, which says the commandpythonshould be Python 2.
– wjandrea
Mar 21 at 16:18
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
add a comment |
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
/usr/bin/pythonshould be Python 2.7. This is per PEP 394, which says the commandpythonshould be Python 2.
– wjandrea
Mar 21 at 16:18
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
thank you very much! gracias!
– Mr.Caringi
Mar 21 at 16:13
/usr/bin/python should be Python 2.7. This is per PEP 394, which says the command python should be Python 2.– wjandrea
Mar 21 at 16:18
/usr/bin/python should be Python 2.7. This is per PEP 394, which says the command python should be Python 2.– wjandrea
Mar 21 at 16:18
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
@wjandrea Thanks for this :D " end users should be aware that python refers to python3 on at least Arch Linux" I failed to read past python3 when I was searching around for the default
– j-money
Mar 21 at 21:28
add a comment |