Skip to content

Instantly share code, notes, and snippets.

Avatar

Raphael Kolm rkz

View GitHub Profile
@rkz
rkz / gist:e60e3b86e1ac8b9806e0
Created Jun 27, 2014
Mail functions for Flask (SMTP settings and e-mail activation in the app's config + rendering a Jinja template as content)
View gist:e60e3b86e1ac8b9806e0
# -*- 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']:
@rkz
rkz / roman_to_number.py
Last active Jun 16, 2019
Roman numbers reader
View roman_to_number.py
#!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
"""