Server IP : 127.0.0.2 / Your IP : 3.148.221.78 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/python-xlsxwriter/docs/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Getting Started with XlsxWriter — XlsxWriter Readme</title> <link rel="stylesheet" href="_static/default.css" type="text/css" /> <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> <script type="text/javascript"> var DOCUMENTATION_OPTIONS = { URL_ROOT: '', VERSION: '0.3.2', COLLAPSE_INDEX: false, FILE_SUFFIX: '.html', HAS_SOURCE: true }; </script> <script type="text/javascript" src="_static/jquery.js"></script> <script type="text/javascript" src="_static/underscore.js"></script> <script type="text/javascript" src="_static/doctools.js"></script> <link rel="top" title="XlsxWriter Readme" href="index.html" /> </head> <body> <div class="related"> <h3>Navigation</h3> <ul> <li><a href="#">XlsxWriter Readme</a> »</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="getting-started-with-xlsxwriter"> <h1>Getting Started with XlsxWriter</h1> <p>Here are some easy instructions to get you up and running with the XlsxWriter module.</p> <div class="section" id="installing-xlsxwriter"> <h2>Installing XlsxWriter</h2> <p>The first step is to install the XlsxWriter module. There are several ways to do this.</p> <div class="section" id="using-pip"> <h3>Using PIP</h3> <p>The <a class="reference external" href="http://www.pip-installer.org/en/latest/index.html">pip</a> installer is the preferred method for installing Python modules from <a class="reference external" href="http://pypi.python.org/pypi">PyPI</a>, the Python Package Index:</p> <div class="highlight-python"><pre>$ sudo pip install XlsxWriter</pre> </div> <div class="admonition note"> <p class="first admonition-title">Note</p> <p class="last">Windows users can omit <tt class="docutils literal"><span class="pre">sudo</span></tt> at the start of the command.</p> </div> </div> <div class="section" id="using-easy-install"> <h3>Using Easy_Install</h3> <p>If <tt class="docutils literal"><span class="pre">pip</span></tt> doesn’t work you can try <a class="reference external" href="http://peak.telecommunity.com/DevCenter/EasyInstall">easy_install</a>:</p> <div class="highlight-python"><pre>$ sudo easy_install install XlsxWriter</pre> </div> </div> <div class="section" id="installing-from-a-tarball"> <h3>Installing from a tarball</h3> <p>If you download a tarball of the latest version of XlsxWriter you can install it as follows (change the version number to suit):</p> <div class="highlight-python"><pre>$ tar -zxvf XlsxWriter-1.2.3.tar.gz $ cd XlsxWriter-1.2.3 $ sudo python setup.py install</pre> </div> <p>A tarball of the latest code can be downloaded from GitHub as follows:</p> <div class="highlight-python"><pre>$ 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</pre> </div> </div> <div class="section" id="cloning-from-github"> <h3>Cloning from GitHub</h3> <p>The XlsxWriter source code and bug tracker is in the <a class="reference external" href="http://github.com/jmcnamara/XlsxWriter">XlsxWriter repository</a> on GitHub. You can clone the repository and install from it as follows:</p> <div class="highlight-python"><pre>$ git clone https://github.com/jmcnamara/XlsxWriter.git $ cd XlsxWriter $ sudo python setup.py install</pre> </div> </div> </div> <div class="section" id="running-a-sample-program"> <h2>Running a sample program</h2> <p>If the installation went correctly you can create a small sample program like the following to verify that the module works correctly:</p> <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="n">xlsxwriter</span> <span class="n">workbook</span> <span class="o">=</span> <span class="n">xlsxwriter.Workbook</span><span class="p">(</span><span class="s">'hello.xlsx'</span><span class="p">)</span> <span class="n">worksheet</span> <span class="o">=</span> <span class="n">workbook</span><span class="o">.</span><span class="n">add_worksheet</span><span class="p">()</span> <span class="n">worksheet</span><span class="o">.</span><span class="n">write</span><span class="p">(</span><span class="s">'A1'</span><span class="p">,</span> <span class="s">'Hello world'</span><span class="p">)</span> <span class="n">workbook</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> </pre></div> </div> <p>Save this to a file called <tt class="docutils literal"><span class="pre">hello.py</span></tt> and run it as follows:</p> <div class="highlight-python"><pre>$ python hello.py</pre> </div> <p>This will output a file called <tt class="docutils literal"><span class="pre">hello.xlsx</span></tt> which should look something like the following:</p> <img alt="_static/hello01.png" src="_static/hello01.png" /> <p>If you downloaded a tarball or cloned the repo, as shown above, you should also have a directory called <a class="reference external" href="https://github.com/jmcnamara/XlsxWriter/tree/master/examples">examples</a> with some sample applications that demonstrate different features of XlsxWriter.</p> </div> </div> <div class="section" id="documentation"> <h1>Documentation</h1> <p>The full version of XlsxWriter documentation is hosted on <a class="reference external" href="http://xlsxwriter.readthedocs.org">Read The Docs</a>. It is also available as a <a class="reference external" href="https://github.com/jmcnamara/XlsxWriter/raw/master/docs/XlsxWriter.pdf">PDF</a>.</p> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"> <p class="logo"><a href="#"> <img class="logo" src="_static/logo.png" alt="Logo"/> </a></p> </div> </div> <div class="clearer"></div> </div> <div class="footer"> © Copyright 2013-2015, John McNamara. </div> </body> </html>