Python code for T-matrix scattering calculations