python XlsxWriter Example: Hello World

http://xlsxwriter.readthedocs.io/example_hello_world.html

The simplest possible spreadsheet. This is a good place to start to see if the XlsxWriter module is installed correctly.

_images/hello01.png

 1 ##############################################################################
 2 #
 3 # A hello world spreadsheet using the XlsxWriter Python module.
 4 #
 5 # Copyright 2013-2016, John McNamara, jmcnamara@cpan.org
 6 #
 7 import xlsxwriter
 8 
 9 workbook = xlsxwriter.Workbook('hello_world.xlsx')
10 worksheet = workbook.add_worksheet()
11 
12 worksheet.write('A1', 'Hello world')
13 
14 workbook.close()
原文地址:https://www.cnblogs.com/UniqueColor/p/6554497.html