TecIO library for python (with SWIG)

Creating Tecplot binary data files

Moderators: davetaflin, salter, steve, jprenaud, straton, Chris Idso

Posts: 6
Joined: Fri May 07, 2010 8:50 am
Location: France

TecIO library for python (with SWIG)

Postby Remy_FR » Mon Apr 18, 2011 1:06 am


I've never seen (on this forum or on internet) a way to use the tecIO library directly with python. If i'm wrong I will be happy you correct me :D.
But in the meantime, I decided to try to make it using the SWIG tool with the C++ source of the tecio library. After some attempt I succeeded to compile and load a module containing TECXXX112 functions without error in python, but at the end I unfortunately get a type error when I tried the TECINI112 function :

Code: Select all

>>> tecio.tecini112("TITLE", "x y z", "Tecplot_file.out", ".", 0, 1, 1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: in method 'tecini112', argument 5 of type 'int *'

I'm not an expert of C++ and SWIG tool, and it seems here it's only a problem of translation of a python integer to a... C pointeur integer I guess. If someone has experience on this kind of interfacing, maybe we could solve this problem and have a useful module for tecplot users... If you want to try I can also post the steps of my method.

Thanks !


Re: TecIO library for python (with SWIG)

Postby Ben » Mon Apr 18, 2011 7:46 am

The tecio functions have a strange parameter syntax (passing integers by pointer, for example) to ease Fortran compatibility.

My suggestion is to create your own thin C++ layer on top of tecio to simplify the interface. Then use SWIG to make the python interface to your layer.

Return to “TecIO Library”

Who is online

Users browsing this forum: No registered users and 1 guest