Bodie's "Investment" (9th edition) supporting question bank after-school exercise answers

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'])

The above is python writing .csv code, click the link for the code source file.

Link: https://pan.baidu.com/s/1jzJ-Nwlnbq4W9qbmkMQzqw

Extraction code: 1zcg

Guess you like

Origin blog.csdn.net/m0_47432290/article/details/106611704