Pweave
I use Pweave for embedding Python code in LaTeX.
Here is my minimal working example.
It uses cals to generate the table.
The Python code generates and calculates the tube measurements.
It is also Python that takes care of formatting the output in the nl_BE.utf8 locale which replaces commas for decimal points.
The first lines of LaTeX comments indicate how to compile this .Pnw file to produce .tex and .pdf files. When in doubt, consult the following excellent article which got me started.
The Python comment shows how to generate additional locales in Debian GNU/Linux.

%sudo easy_install -U Pweave
%Pweave -f tex filename.Pnw | pdflatex -synctex=1 -interaction=nonstopmode filename.tex
\documentclass{article}
%text symbols
\usepackage{textcomp}
%table
\usepackage{cals}
\begin{document}
\makeatletter
\begin{calstable}
\colwidths{{12mm}{18mm}{18mm}{12mm}{15mm}}
\def\cals@cs@width{0pt} %no vertical column separation lines
\setlength{\cals@paddingT}{3pt}
\setlength{\cals@paddingB}{2pt}
\alignC
\thead{\brow \cell{sectie} \cell{$D_{out}$\,(m)} \cell{$D_{in}$\,(m)} \cell{$\ell$\,(m)} \cell{$A$\,(m\texttwosuperior)} \erow}
<%
from math import pi
from locale import setlocale, LC_ALL, format
#sudo dpkg-reconfigure locales
setlocale(LC_ALL, 'nl_BE.utf8')
Atot = 0
for i in range(0,6):
section = i + 1
Dout = 0.060 - i * 0.005
Din = Dout - 0.004
length = 1.8
A = pi * (Dout + Din) * length + pi / 2.0 * (Dout**2 - Din**2)
print('\\brow \\cell{%s} \\cell{%s} \\cell{%s} \\cell{%s} \\cell{%s} \\erow' % (section, format('%.3f', Dout), format('%.3f', Din), format('%.2f', length), format('%.2f', A)))
Atot += A
%>
\tfoot{\brow \alignR \nullcell{ltb} \nullcell{tb} \nullcell{tb} \nullcell{tbr} \spancontent{Totaal:} \alignC \cell{<%=format('%.2f', Atot)%>} \erow}
\end{calstable}
\makeatother
De totale oppervlakte bedraagt <%=format('%.2f', Atot)%>\,m\texttwosuperior.
\end{document}