Skip to content

Instantly share code, notes, and snippets.

@cdunklau
cdunklau / python-bitly-links.py
Last active January 29, 2017 20:05
Short links to good texts and presentations about Python, from a few of the denizens of #python
@cdunklau
cdunklau / extract_attachments.py
Last active September 18, 2024 16:23
A simple (and probably naive) script to extract attachments from .eml files for those of us who don't use software email clients.
#!/usr/bin/env python
"""
Extract all attachments from MS Outlook '.eml' file EML_FILE into
directory OUTPUT_DIR. If OUTPUT_DIR does not exist, it will be
created.
Usage: extract_attachments.py EML_FILE OUTPUT_DIR
"""
from __future__ import print_function
import sys
class IndexProxy(object):
"""
Proxies access to a multidimensional sequence.
When the constructor is provided with a sequence of dimension N,
item access with iterables of length <= N will retrieve the subsequence
or item at the depth corresponding to the distance. For example:
ip = IndexProxy(multiseq)
ip[1,4] == multiseq[1][4]
@cdunklau
cdunklau / .gitignore
Last active January 3, 2016 10:09 — forked from habnabit/chatserver.py
Chatserver Nightmare! Now with flake8 compliance!
*.py[co]