Liu Hongwen "Materials Mechanics" (5th edition) notes and after-school exercises (including postgraduate entrance examination papers) detailed explanation

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/1DAl6AagzitX8MxkgSS6o4g

Extraction code: srwo

 

Guess you like

Origin blog.csdn.net/m0_47432812/article/details/106680106