Skip to content

Instantly share code, notes, and snippets.

@rkz
rkz / roman_to_number.py
Last active June 16, 2019 08:58
Roman numbers reader
#!python3
"""
Usage: roman_to_number.py [-v] <roman_number>
Read a roman number (e.g. CDXCVII) and print its base10 value (e.g. 497).
Options:
-v Show computation steps and error details
"""
@rkz
rkz / gist:e60e3b86e1ac8b9806e0
Created June 27, 2014 15:03
Mail functions for Flask (SMTP settings and e-mail activation in the app's config + rendering a Jinja template as content)
# -*- coding: utf-8 -*-
import smtplib
from email.mime.text import MIMEText
from . import app
def send(recipients, subject, body):
# Destination override
if app.config['EMAIL_TO']: