Download+and+Installation

media type="custom" key="330263" =pip= code pip install pyparsing code Many Linux distributions now come with pyparsing installed, but not always the latest version. To get the latest use: code pip install -U pyparsing code

=easy_install= Install pyparsing using setuptool easy_install command: code easy_install pyparsing code If setuptools has difficulties in dealing with Wikispaces as the project home page, try this command instead: code easy_install http://cheeseshop.python.org/packages/source/p/pyparsing/pyparsing-2.1.3.tar.gz code //Note: that this installs binary pyparsing distribution, which **doesn't include any example programs or API reference**. For downloading docs, see appropriate links below.//

=Downloading= Pyparsing is currently hosted on SourceForge. The download URL for the project is http://sourceforge.net/project/showfiles.php?group_id=97203.

SourceForge lists multiple versions for download, and for each version, several different release packages. The current packaging for pyparsing consists of the following packages: To download a package, simply open the download web page and click on the package's name, and the download process should start. Select an empty scratch directory to download the package into, to avoid overwriting any existing files.
 * Source .zip
 * Source .tar.gz
 * Windows binary installer .exe
 * Python wheel
 * Docs and examples .zip


 * ===**Getting sources from Subversion**===

The source can be downloaded from project's Subversion repository with the following SVN command:

>

Or you can browse the repository with your browser, at:

> ||

=Installing=

Windows (binary .exe)
If you download the Windows binary installer, you can simply run this executable, and pyparsing will be installed into the Python site-packages directory. //Note: the Windows binary installer does **not** install any of the example programs or class documentation. Please download and unpack the docs package or one of the source packages (either .zip or .tar.gz).//

Windows (source .zip)
If you download the source .zip file, you can extract the archive contents to a scratch directory. From this directory, use the setup.py script with the command: code python setup.py install code This will install pyparsing to the Python site-packages directory. Please save this scratch directory, as it will also contain a directory of class documentation (htmldocs) and a directory of code examples (examples).

Linux (source .tar.gz)
The source .tar.gz file contains the pyparsing source, documentation, and examples directory as a compressed Gzip'ed tar archive. First uncompress the archive using (replace "x.x.x" with the appropriate version numbers): code gunzip pyparsing-x.x.x.tar.gz code Then extract the files from the tar archive using: code tar -xvf pyparsing-x.x.x.tar code This should create a subdirectory named 'pyparsing-x.x.x', containing further subdirectories containing the source code, documentation, examples, etc. In a console window, cd to this directory, and install pyparsing using: code python setup.py install code This will install pyparsing to the Python site-packages directory. You should save this scratch directory, for future reference to the help and example files.

Mac OS X (source .tar.gz)
Follow the same instructions as given above for Linux. Note that your Mac browser may automatically run gunzip on the downloaded file, so you may be able to go directly to processing the .tar archive file.

=Testing / Verifying= The simplest way to verify that your pyparsing installation is complete is to run the Hello, World! example. Use the appropriate commands for your OS to create a console command input window, and set the working directory to the pyparsing examples directory. Then run the script hello.py, using the command: code python greeting.py code You should see the following output: code Hello, World! -> ['Hello', ',', 'World', '!']

code

You're ready to start writing Python parsers with pyparsing!

media type="custom" key="290873"