import tecplot 
import numpy

tecplot.session.connect()

dataset = tecplot.data.load_tecplot("DuctFlow.plt")
plot = tecplot.active_frame().plot()

plot.contour(0).variable = dataset.variable('P(N/m2)')

plot.show_slices = True

plot.slice(0).effects.use_translucency = True
plot.slice(0).effects.surface_translucency = 20

x = dataset.variable("X(M)")
n = 0
for i in numpy.arange(x.min(), x.max()+0.1, 0.1):
    plot.slice(0).origin.x = i
    filename = "slice" + str(n) + str(i) + ".png"
    tecplot.export.save_png(filename, 1024, supersample=3)
    n = n + 1