Peng Lanの「ネットワーク通信入門」(第4版)のメモと授業後の演習への回答


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

上記は、.csvコードを記述しているpythonです。コードソースファイルのリンクをクリックしてください。

リンク:https//pan.baidu.com/s/15OA_oUKJh-4Heh8hEIIgXw

抽出コード:su3l

おすすめ

転載: blog.csdn.net/m0_46570951/article/details/109065122