finish the dump_data() function by using python csv module