A pythonic version of the 1dheat code