Skip to content

Instantly share code, notes, and snippets.

View mplewis's full-sized avatar
🐕
柴犬

Matt Lewis mplewis

🐕
柴犬
View GitHub Profile
#!/usr/bin/env python
import os
import sys
# print_compact_dir recursively prints the contents of the directory with indentation and without stuttering.
# If the only contents of a given directory are another single directory, that single directory is concatenated instead of indented on the next line.
def print_compact_dir(root, route, level, spacing=4):
dir_path = os.path.join(root, route)
contents = os.listdir(dir_path)
@mplewis
mplewis / snowjob.py
Created December 24, 2012 06:42 — forked from sontek/snowjob.py
#!/usr/bin/env python
import os
import random
import time
import platform
snowflakes = {}
try:
# Windows Support