File: python_binding.txt

package info (click to toggle)
presage 0.9.1-2.7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,896 kB
  • sloc: cpp: 86,289; sh: 11,775; ansic: 4,043; python: 1,218; makefile: 1,026; cs: 1,009; xml: 57
file content (84 lines) | stat: -rw-r--r-- 2,879 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
Copyright (C) 2008  Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
______________________
Presage Python binding
~~~~~~~~~~~~~~~~~~~~~~

A Python binding for Presage is automatically built when the build
system determines that the following software requirements are
satisfied:
  - Python (include development headers)
  - SWIG

You can optionally disable building of the python binding by passing
the --disable-python-binding flag to configure.

The Python binding is a Python extension module that wraps around the
presage library. The Python extension module is built using SWIG
and the Python Distribution Utilities package (distutils).


To use the Python binding for presage

1) Ensure that the Python extension module is enabled by checking that
   ./configure configuration summary reports the following:

    Python binding: ............. yes


2) Build and install as usual
   
   make
   make install


3) An additional _presage library will have been built and
   installed into your system Python extension library directory. This
   is the presage Python extension module.


4) You should now be able to use Presage from Python. Read through the
   presage_python_demo script in the bindings/python directory for an
   example and try running it.



A few points to note if you installed in a non-default location:

- the Python extension module _presage.so (_presage.dll) depends
  on libpresage.so (libpresage.dll), so ensure that it is on the
  runtime loader path (i.e. LD_LIBRARY_PATH on Linux/Solaris, LIBPATH
  on AIX, PATH on Windows, etc.)

- the Python extension module _presage.so needs to be in a standard
  Python extension library directory in order for Python to find it,
  or the directory containing the extension module needs to be added
  to the PYTHONPATH environment variable


The presage python API is generated from the presage C++ API by SWIG.
As such, it follows SWIG conventions for mapping Python code to C++
code. A minimal description of the presage python module interface is
available from the python interpreter itself by executing:
>>> import presage
>>> help (presage)


########/

Copyright (C) 2008  Matteo Vescovi <matteo.vescovi@yahoo.co.uk>

Presage is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

########\