I could add #! /usr/bin/python in the beginning of python script and add this script to PATH in order to run it as a command.
But could anyone explain to me what does '#' and '!' mean separately in python and what other language has this mechanism? Thanks
1a : the thing one intends to convey especially by language : purport Do not mistake my meaning. b : the thing that is conveyed especially by language : import Many words have more than one meaning. 2 : something meant or intended : aim a mischievous meaning was apparent.
In the English language the word the is classified as an article, which is a word used to define a noun. (More on that a little later.)
The is used to refer to specific or particular nouns; a/an is used to modify non-specific or non-particular nouns. We call the the definite article and a/an the indefinite article. For example, if I say, "Let's read the book," I mean a specific book.
This is the shebang line and the #! are magic numbers interpreted by the program loader on unix systems and used to start the script interpreter.
#
followed by anything is a comment; so far as Python itself is concerned, that's it. Unix, on the other hand, will parse out the /usr/bin/python
so that it knows how to run your code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With