"Previous Section"_Modify.html - "LAMMPS WWW Site"_lws -
"LAMMPS Documentation"_ld - "LAMMPS Commands"_lc - "Next
Section"_Errors.html :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Commands_all.html)

:line

Use Python with LAMMPS :h2

These doc pages describe various ways that LAMMPS and Python can be
used together.

<!-- RST

.. toctree::
   :maxdepth: 1

   Python_overview
   Python_run
   Python_shlib
   Python_install
   Python_mpi
   Python_test
   Python_library
   Python_pylammps
   Python_examples
   Python_call

END_RST -->

<!-- HTML_ONLY -->

"Overview of Python and LAMMPS"_Python_overview.html
"Run LAMMPS from Python"_Python_run.html
"Build LAMMPS as a shared library"_Python_shlib.html
"Install LAMMPS in Python"_Python_install.html
"Extend Python to run in parallel"_Python_mpi.html
"Test the Python/LAMMPS interface"_Python_test.html
"Python library interface"_Python_library.html
"PyLammps interface"_Python_pylammps.html
"Example Python scripts that use LAMMPS"_Python_examples.html
"Call Python from a LAMMPS input script"_Python_call.html :all(b)

<!-- END_HTML_ONLY -->

If you're not familiar with "Python"_http://www.python.org, it's a
powerful scripting and programming language which can do most
everything that lower-level languages like C or C++ can do in fewer
lines of code.  The only drawback is slower execution speed.  Python
is also easy to use as a "glue" language to drive a program through
its library interface, or to hook multiple pieces of software
together, such as a simulation code plus a visualization tool, or to
run a coupled multiscale or multiphysics model.

See the "Howto_couple"_Howto_couple.html doc page for more ideas about
coupling LAMMPS to other codes.  See the "Howto
library"_Howto_library.html doc page for a description of the LAMMPS
library interface provided in src/library.h and src/library.h.  That
interface is exposed to Python either when calling LAMMPS from Python
or when calling Python from a LAMMPS input script and then calling
back to LAMMPS from Python code.  The library interface is designed to
be easy to add functionality to.  Thus the Python interface to LAMMPS
is also easy to extend as well.

If you create interesting Python scripts that run LAMMPS or
interesting Python functions that can be called from a LAMMPS input
script, that you think would be generally useful, please post them as
a pull request to our "GitHub site"_https://github.com/lammps/lammps,
and they can be added to the LAMMPS distribution or webpage.
