Python Code To Flatten Into A Sheet