This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def message(name): | |
| return "Hello {}".format(name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def message(name): | |
| msg = "<div class='mymessage'>" | |
| msg += "<p>Hello " + name + "</p>" | |
| msg += "</div>" | |
| return msg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def tagger_div(f): | |
| def wrapper(name): | |
| return "<div>" + f(name) + "</div>" | |
| return wrapper | |
| def tagger_par(f): | |
| def wrapper(name): | |
| return "<p>" + f(name) + "</p>" | |
| return wrapper |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @tagger_div | |
| @tagger_par | |
| def message(name): | |
| return "Hello {}".format(name) | |
| print(message("Yanwar")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @tagger_par | |
| def message(name): | |
| return "Hello {}".format(name) | |
| print(message("Yanwar")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def function1(): | |
| def function1a(): | |
| return "Hello Yanzen" | |
| return function1a | |
| print(function1()()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def function1(f): | |
| return f | |
| def function1a(): | |
| return "Hello Yanzen" | |
| my_function = function1(function1a) | |
| print(my_function()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.contrib.auth.models import User | |
| class EmailAuthBackend(object): | |
| """ | |
| Authenticate menggunakan e-mail. | |
| """ | |
| def authenticate(self, username=None, password=None): | |
| try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from flask import Flask | |
| app = Flask(__name__) | |
| from app import views |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from app import app | |
| app.run(debug=True) |