Bewildered graphs

Roman Suzi rnd at onego.ru
Sun Jul 6 03:01:32 EDT 2003


Here is ploticus.i file I made 30 minutes ago:

(READ DISCLAIMER AT THE END)

------------------------------------------------------------------
/* ploticus.i */
 %module ploticus
 %{
 /* Put header files here (optional) */
 %}

%name(init) extern ploticus_init( char *device, char *outfilename );
%name(arg) extern ploticus_arg( char *name, char *value );
%name(begin) extern ploticus_begin();
%name(execline) extern ploticus_execline( char *line );
%name(execscript) extern ploticus_execscript( char *scriptfile, int prefab );
%name(end) extern ploticus_end();
%name(setvar) extern ploticus_setvar( char *name, char *value );
%name(getvar) extern ploticus_getvar( char *name, char *value );
-----------------------------------------------------------------------

If you have SWIG, just do this:

0. install SWIG

1. get Ploticus source (plsrc211.tgz in my case) untarred

2. cd plsrc211/src

3. make -f Makefile_api

4. put my ploticus.i into current dir (plsrc211/src)

5. run:   
   swig -python ploticus.i
   gcc -c ploticus_wrap.c -I /usr/local/include/python2.3
   ld -shared ploticus_wrap.o -l gd libploticus.a -o ploticus.so

(/usr/local/include/python2.3 - in my case, your Python could be
somewhere else)

6. check:

   python

>>> import ploticus
>>> dir(ploticus)
['__doc__', '__file__', '__name__', 'arg', 'begin', 'end', 'execline', 
'execscript', 'getvar', 'init', 'setvar']
>>> # do whatever with it


DISCLAIMER:
I never used neither SWIG nor Ploticus before. So it is hard to tell
if ploticus Python wrapper works ;-)


Sincerely yours, Roman Suzi
-- 
rnd at onego.ru =\= My AI powered by GNU/Linux RedHat 7.3






More information about the Python-list mailing list