To get started with BornAgain scripting, run a first example.
We shall now run a first example script.
This and all other example scripts can also be found in the BornAgain distribution,
Download the following example script,
using the link just below the code frame.
Save the script under the name
For a discussion of the content of this script, see simulation/reflectometry.
At the command prompt in a terminal, launch the script with the command
(on systems that still have Python2, the command may rather be
As result, a MatPlotLib window should pop up, and display this reflectometry curve:
Under a Unix shell,
the script can also be launched without typing
python at the command prompt:
This is made possible by the line “
#!/usr/bin/env python3” on top of the script.
It may be necessary to make the script executable by
chmod a+x AlternatingLayers.py