How to Decorate Imported Libs in Python for Jinja Template Filters in Flask
To decorate an imported function in Python you would do something like this # in ./lib.py def function_name(): # function body And then in your program you could decorate it like this from lib import function_name function_name = decorat...
Written by Sean Behan on 03/04/2017
Get Method Name as String in Python
Here is how to get the string representation of a method in Python def my_method_name(): print "Hello World" my_method_name.__name__ # => 'my_method_name' Short and sweet!
Written by Sean Behan on 03/04/2017