Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the symbol "#!" mean in Python?

Tags:

python

shebang

What does this line of code mean? Without it, my python3 http server can't understand and let the browser download an empty .py file (depend on the link to the .py file)

#! /usr/local/bin/python3
like image 940
Amumu Avatar asked Jun 09 '11 06:06

Amumu


People also ask

What does this symbol ∼ mean?

"∼" is one of many symbols, listed in the Wikipedia article on approximation, used to indicate that one number is approximately equal to another. Note that "approximately equal" is reflexive and symmetric but not transitive. "∼" is one of many symbols used in logic to indicate negation.

What is this symbol & called?

The ampersand, also known as the and sign, is the logogram &, representing the conjunction "and". It originated as a ligature of the letters et—Latin for "and".

Where do we use the symbol @?

The at sign is used in email addresses and typically separates a username from a domain name in an email address.

What do a symbol mean?

Definition of symbol (Entry 1 of 2) 1 : an authoritative summary of faith or doctrine : creed. 2 : something that stands for or suggests something else by reason of relationship, association, convention, or accidental resemblance especially : a visible sign of something invisible the lion is a symbol of courage.


1 Answers

It's not a Python thing, it a hashbang (or shebang) line which indicates which interpreter should process the file.

The rules vary but, in its simplest form, a file with the name xyz (containing that as the first line), when run from the command line with xyz, will run it using that interpreter, similar to:

/usr/local/bin/python3 xyz
like image 200
paxdiablo Avatar answered Oct 06 '22 00:10

paxdiablo