Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 669 Bytes

README.md

File metadata and controls

36 lines (24 loc) · 669 Bytes

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)