sayings.py
author Peter Koppatz <peter@koppatz.com>
Mon, 10 Mar 2014 05:29:13 +0100
changeset 225 311bacddc157
parent 218 6c624624327c
permissions -rw-r--r--
Errors in sayings removed
peter@146
     1
from flask.ext.babel import gettext as _
peter@141
     2
from random import shuffle
peter@141
     3
peter@141
     4
def get_saying():
rb@218
     5
    sayings = [(_(u'The Zen of Python, by Tim Peters'), _(u'__Tim Peters, The Zen of Python')),
rb@218
     6
               (_(u"Beautiful is better than ugly."), _(u'__Tim Peters, The Zen of Python')),
rb@218
     7
               (_(u"Explicit is better than implicit."), _(u'__Tim Peters, The Zen of Python')),
rb@218
     8
               (_(u"Simple is better than complex."), _(u'__Tim Peters, The Zen of Python')),
rb@218
     9
               (_(u"Complex is better than complicated."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    10
               (_(u"Flat is better than nested."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    11
               (_(u"Sparse is better than dense."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    12
               (_(u"Readability counts."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    13
               (_(u"Special cases aren't special enough to break the rules."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    14
               (_(u"Although practicality beats purity."), _(u'__Tim Peters, The Zen of Python')),
peter@225
    15
               (_(u"Errors should never pass silently, unless explicitly silenced."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    16
               (_(u"In the face of ambiguity, refuse the temptation to guess."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    17
               (_(u"Although that way may not be obvious at first unless you're Dutch."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    18
               (_(u"Now is better than never."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    19
               (_(u"Although never is often better than *right* now."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    20
               (_(u"If the implementation is hard to explain, it's a bad idea."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    21
               (_(u"If the implementation is easy to explain, it may be a good idea."), _(u'__Tim Peters, The Zen of Python')),
rb@218
    22
               (_(u"Namespaces are one honking great idea -- let's do more of those!"), _(u'__Tim Peters, The Zen of Python')),
rb@218
    23
               (_(u"I once tried Java, but it was too complicated for me, Python is easier."),_(u'__Valentin Pratz,  novice programmers')),
peter@144
    24
               ]
peter@144
    25
    
peter@141
    26
    shuffle(sayings)
peter@144
    27
    
peter@141
    28
    saying, author = sayings[0]
peter@141
    29
    return saying, author
Impressum Datenschutzerklärung