Repository navigation
Expand file tree
/
Copy pathgetting_started.txt
More file actions
122 lines (71 loc) · 2.99 KB
/
Copy pathgetting_started.txt
File metadata and controls
122 lines (71 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
.. _getting_started:
Getting Started with XlsxWriter
===============================
Here are some easy instructions to get you up and running with the XlsxWriter
module.
Installing XlsxWriter
---------------------
The first step is to install the XlsxWriter module. There are several ways to
do this.
Using PIP
*********
The `pip <http://www.pip-installer.org/en/latest/index.html>`_ installer is
the preferred method for installing Python modules from
`PyPI <http://pypi.python.org/pypi>`_, the Python Package Index::
$ sudo pip install XlsxWriter
.. Note::
Windows users can omit ``sudo`` at the start of the command.
Using Easy_Install
******************
If ``pip`` doesn't work you can try
`easy_install <http://peak.telecommunity.com/DevCenter/EasyInstall>`_::
$ sudo easy_install install XlsxWriter
Installing from a tarball
*************************
If you download a tarball of the latest version of XlsxWriter you can install
it as follows (change the version number to suit)::
$ tar -zxvf XlsxWriter-1.2.3.tar.gz
$ cd XlsxWriter-1.2.3
$ sudo python setup.py install
A tarball of the latest code can be downloaded from GitHub as follows::
$ curl -O -L http://github.com/jmcnamara/XlsxWriter/archive/master.tar.gz
$ tar zxvf master.tar.gz
$ cd XlsxWriter-master/
$ sudo python setup.py install
Cloning from GitHub
*******************
The XlsxWriter source code and bug tracker is in the
`XlsxWriter repository <http://github.com/jmcnamara/XlsxWriter>`_ on GitHub.
You can clone the repository and install from it as follows::
$ git clone https://github.com/jmcnamara/XlsxWriter.git
$ cd XlsxWriter
$ sudo python setup.py install
Running a sample program
------------------------
If the installation went correctly you can create a small sample program like
the following to verify that the module works correctly:
.. code-block:: python
from xlsxwriter.workbook import Workbook
workbook = Workbook('hello.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write('A1', 'Hello world')
workbook.close()
Save this to a file called ``hello.py`` and run it as follows::
$ python hello.py
This will output a file called ``hello.xlsx`` which should look something like
the following:
.. image:: _static/hello01.png
If you downloaded a tarball or cloned the repo, as shown above, you should also
have a directory called
`examples <https://github.com/jmcnamara/XlsxWriter/tree/master/examples>`_
with some sample applications that demonstrate different features of
XlsxWriter.
Documentation
-------------
The latest version of this document is hosted on
`Read The Docs <https://xlsxwriter.readthedocs.org/en/latest/>`_. It is
available in several formats such as
`Html, PDF and ePub <https://readthedocs.org/projects/xlsxwriter/downloads/>`_.
Once you are happy that the module is installed and operational you can have a
look at the rest of the XlsxWriter documentation. :ref:`tutorial1` is a good
place to start.