高鸿业《西方经济学微观部分》(第七7版)笔记和课后习题答案真题解


import csv

def write_csv_file(rows = [], user_file_name = 'index'):
    with open(user_file_name + '.csv', 'w', newline='') as csv_file:
        writer = csv.writer(csv_file)
        writer.writerows(rows)
    print('Writing to ' + user_file_name + '.csv'+ ' has compeleted')


if __name__ == "__main__":
  rows = ['Item','name','quantity']
	user_parameter['file_name'] = 'text'
	write_csv_file(rows, user_parameter['file_name'])

以上是python写.csv代码,代码源文件点击链接.

链接:https://pan.baidu.com/s/1ld-Fk9MZEdUdf6DThH0j3w

提取码:x9kb

你可能感兴趣的:(高鸿业《西方经济学微观部分》(第七7版)笔记和课后习题答案真题解)