manpagez: man pages & more
info mathgl_en
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.8.2 C++/Python interface

MathGL provides the interface to a set of languages via SWIG library. Some of these languages support classes. The typical example is Python – which is named in this chapter’s title. Exactly the same classes are used for high-level C++ API. Its feature is using only inline member-functions what make high-level API to be independent on compiler even for binary build.

There are 3 main classes in:

To use Python classes just execute ‘import mathgl’. The simplest example will be:

import mathgl
a=mathgl.mglGraph()
a.Box()
a.WritePNG("test.png")

Alternatively you can import all classes from mathgl module and easily access MathGL classes like this:

from mathgl import *
a=mglGraph()
a.Box()
a.WritePNG("test.png")

This becomes useful if you create many mglData objects, for example.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on March 21, 2014 using texi2html 5.0.

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.