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
| # I suggest you use memcached or redis as backend | |
| import time | |
| import json | |
| from functools import wraps | |
| def cached(timeout=1800): | |
| def wrapper(f): | |
| @wraps(f) |
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
| import time | |
| from datetime import datetime | |
| import requests | |
| URL = 'https://example.com' | |
| CHECK_SECONDS = 60 | |
| def monitor(): |
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 number_to_georgian(amount, currency): | |
| if currency == 'GEL': | |
| main_unit = 'ლარი' | |
| fractional_unit = 'თეთრი' | |
| elif currency == 'USD': | |
| main_unit = 'დოლარი' | |
| fractional_unit = 'ცენტი' | |
| elif currency == 'EUR': | |
| main_unit = 'ევრო' | |
| fractional_unit = 'ცენტი' |
OlderNewer