This file contains 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 render_pdf_weasyprint(html): | |
from weasyprint import HTML | |
pdf = HTML(string=html.encode('utf-8')) | |
return pdf.write_pdf() | |
def render_pdf_xhtml2pdf(html): | |
"""mimerender helper to render a PDF from HTML using xhtml2pdf. | |
Usage: http://philfreo.com/blog/render-a-pdf-from-html-using-xhtml2pdf-and-mimerender-in-flask/ | |
""" |
This file contains 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
#!/usr/bin/env python | |
import tkinter as tk | |
import math | |
import re | |
from collections import ChainMap | |
Nrows = 5 | |
Ncols = 5 |
This file contains 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 sys | |
import re | |
import os | |
import zipfile | |
import shutil | |
# Constant Definition | |
# ------------------- | |
# Path to be prepended to image links in markdown file, like so: ![](IMAGE_LINK<image_filename>). |
This file contains 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 cStringIO | |
import PIL.Image | |
from ssim import compute_ssim | |
def get_ssim_at_quality(photo, quality): | |
"""Return the ssim for this JPEG image saved at the specified quality""" | |
ssim_photo = cStringIO.StringIO() | |
# optimize is omitted here as it doesn't affect | |
# quality but requires additional memory and cpu |
This file contains 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 sys | |
import re | |
import os | |
import zipfile | |
import shutil | |
# Constant Definition | |
# ------------------- |
This file contains 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
#!/usr/bin/python3 | |
""" | |
tkentrycomplete.py | |
A tkinter widget that features autocompletion. | |
Created by Mitja Martini on 2008-11-29. | |
Converted to Python3 by Ian weisser on 2014-04-06. | |
Edited by Victor Domingos on 2016-04-25. |
This file contains 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
#!/usr/bin/python3 | |
""" | |
tkentrycomplete.py | |
A tkinter widget that features autocompletion. | |
Created by Mitja Martini on 2008-11-29. | |
Converted to Python3 by Ian weisser on 2014-04-06. | |
""" |
This file contains 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
# Card Game | |
# | |
# In this game, you have to find matching pairs of cards. | |
# This scene consists entirely of layers and demonstrates some | |
# interesting animation techniques. | |
from scene import * | |
from random import shuffle | |
from functools import partial | |
import sound |
This file contains 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
#!/usr/bin/env python | |
import BeautifulSoup | |
import mechanize | |
import csv | |
import sys | |
import logging | |
logging.basicConfig(level=logging.INFO) | |
headers = ["ModuleName", "Group", "Language", "Activity", "ING", "YearPhase", |