Skip to content

Instantly share code, notes, and snippets.

@jmelesky
jmelesky / runningavg.py
Created October 20, 2011 04:25 — forked from schmichael/runningavg.py
Handy script for calculating averages streamed via stdin
#!/usr/bin/env python
import sys
import math
CHUNK = 100
if len(sys.argv) > 1:
CHUNK = int(sys.argv[1])
s = 0