This tutorial covers introduction to solving linear optimization models using Pyomo. Pyomo (http://www.pyomo.org/) is an optimization modelling language based in Python that makes specifying and solving optimization problems in Python very convenient.
Pyomo_Tutorial.pptx discusses installation steps and describes the transportation model that I use for the tutorial.
transportation.py has the actual model coded in Python 3.6. There are a lot of comments in the file describing how to use Pyomo.