diff --git a/python/README b/python/README index f0e95d3c45..87b1956092 100644 --- a/python/README +++ b/python/README @@ -34,6 +34,32 @@ using the same interface described here for wrapping LAMMPS. ------------------------------------------------------------------- +Alternative Python wrapper for LAMMPS + +In addition to the original wrapper, you can use the PyLammps or IPyLammps +wrappers to create simpler Python scripts and IPython notebooks. + +>>> from lammps import lammps, PyLammps, IPyLammps +>>> lmp = lammps() +>>> L = PyLammps(lmp) + +Using these higher-level wrappers translates any function call into their +corresponding LAMMPS command. Arguments are either passed as one +string or individual parameters. Parameter lists are automatically +joined to one command string. E.g., + +>>> L.velocity("all create", 1.44, 87287, "loop geom") + +is translated into the following call in the original interface: + +>>> lmp.command("velocity all create 1.44 87287 loop geom") + +It also gives you an easier way to query the system state, evaluate variable +expressions and access atom data. See examples/ipython/interface_usage.ipynb +for more details. + +------------------------------------------------------------------- + Once you have successfully wrapped LAMMPS, you can run the Python scripts in the examples sub-directory: