These can get big so, use cStringIO instead and use a generator instead of a list.