Skip to content

Files

Latest commit

 

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Python

Some notes:

Decorators

These are fun; basically, they're just syntactic sugar. See this article.

@viking_chorus
def menu_item():
    print("spam")

Is the same as:

def menu_item():
    print("spam")
menu_item = viking_chorus(menu_item)

name = main

The __name__ == '__main__' Python idiom is used to ensure that a script is started only when the script is executed directly. Otherwise, it is skipped.

Defining app

It is totally OK to wrap app a couple of times.

app = Flask(__name__)

manager = Manager(app)
bootstrap = Bootstrap(app)