The tutorials below introduce some computational tools in Python that will be useful in various physics classes. They are designed to get you started quickly by explaining example code that you can modify. There are also links to additional documentation where you can learn more. The tutorials are written as Jupyter notebooks (formerly known as IPython notebooks). Click on the links to view HTML versions of the tutorials (produced by nbviewer), where you can also download the notebook (.ipynb) files.
The programs require Python with the scipy and matplotlib libraries. Either of the following free options are suggested:
It is a good idea to start all of your programs with the following line (note that there are 2 underscores before and after "future"):
from __future__ import division, print_functionIf you use Python 2, this will avoid the result of division being rounded to an integer (for example, "2/3" will not give zero) and will use the newer form of the print function. If you use Python 3, this will have no effect.
From within the notebook viewer, you can copy segments of Python code from a tutorial. You can also download a tutorial as a Jupyter notebook, which allows you to edit it.
These tutorials are maintained by Alan DeWeerd.