Python write variable to csv