Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2003-07-15 04:51:43
Size: 2544
Editor: dsl092-192-166
Comment:
Revision 7 as of 2004-11-30 09:18:55
Size: 2831
Editor: 82-68-80-137
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Sip is a tool for quickly writing Python modules that interface with C++ libraries. It's home page is at [http://riverbankcomputing.co.uk/sip/]. It was written by Phil Thompson who is still actively maintaining it. Sip is a tool for quickly writing Python modules that interface with C++ and C libraries. It's home page is at [http://riverbankcomputing.co.uk/sip/]. It was written by Phil Thompson who is still actively maintaining it.
Line 5: Line 5:
There isn't much information on the 'net about sip -- see below for some hints on where you can find documentation. Your best bet is to read PyQt and PyKDE and ask Phil Thompson and Jim Bublitz for help. Full documentation can be found at [http://www.river-bank.demon.co.uk/docs/sip/sipref.html].
Line 9: Line 9:
Sip can be used to interface with C libraries. A simple wrapper written in C++ is usually necessary, although sip may become more C-friendly in the future. A proof of concept can be found with Jonathan Gardner's ["sipPQ"], a python module that interfaces directly with libpq, which is the C library used to interface with PostgreSQL. You can find this at [http://sourceforge.net/project/showfiles.php?group_id=61057]. Since v4.0 Sip can be used to interface with C libraries.

For earlier version of Sip, a
simple wrapper written in C++ was usually necessary. A proof of concept can be found with Jonathan Gardner's ["sipPQ"], a python module that interfaces directly with libpq, which is the C library used to interface with PostgreSQL. You can find this at [http://sourceforge.net/project/showfiles.php?group_id=61057].
Line 14: Line 16:
Sip is really the combination of three components. Sip is really the combination of four components.
Line 16: Line 18:
 1. A scripting language that roughly resembles C++ that describes how the Python library will interface with the C++ library.
 1. A tool to convert the script into C++ code and Python modules, to be compiled into shared libraries.
 1. A library to support the resulting libraries.
 1. A scripting language that roughly resembles C++ that describes how the Python module will interface with the C++ library.
 1. A tool to convert the script into C++ code and Python modules.
 1. A module to support the resulting Python modules and allow the programmer access to some of the Sip internals for special cases.
 1. A pure Python build system that support dozens of platform/compiler combinations.
Line 40: Line 43:

== Tutorials & additional docs staff ==
Googling the web on SIP tutorials brought up

 * [http://www.controlvideo.de/sip/]
 * [http://www.river-bank.demon.co.uk/docs/sip/sipref.html Official Documentation]
 * [http://www.pegasus.rutgers.edu/~elflord/unix/siptute/]

sip

Sip is a tool for quickly writing Python modules that interface with C++ and C libraries. It's home page is at [http://riverbankcomputing.co.uk/sip/]. It was written by Phil Thompson who is still actively maintaining it.

Full documentation can be found at [http://www.river-bank.demon.co.uk/docs/sip/sipref.html].

Sip is used principally to support PyQt and ["PyKDE"]. Without it, it would be near impossible to manage the vast APIs these libraries provide.

Since v4.0 Sip can be used to interface with C libraries.

For earlier version of Sip, a simple wrapper written in C++ was usually necessary. A proof of concept can be found with Jonathan Gardner's ["sipPQ"], a python module that interfaces directly with libpq, which is the C library used to interface with PostgreSQL. You can find this at [http://sourceforge.net/project/showfiles.php?group_id=61057].


More Details

Sip is really the combination of four components.

  1. A scripting language that roughly resembles C++ that describes how the Python module will interface with the C++ library.
  2. A tool to convert the script into C++ code and Python modules.
  3. A module to support the resulting Python modules and allow the programmer access to some of the Sip internals for special cases.
  4. A pure Python build system that support dozens of platform/compiler combinations.


Excerpt from [http://pegasus.rutgers.edu/~elflord/unix/siptute/ Programming With Sip]:

Introduction

This is by no means an authoritative discussion about SIP. Rather, it is a chronicle of the adventures and misadventures of a bumbling newbie trying to learn to use a great tool with little documentation. Some references that are essential in conjunction to this include:

  • PyQt: an implementation of Python bindings for Qt. Reading the Sip files for these classes is instructive.

  • [http://www.controlvideo.de/sip/ Sip documentation]. This is by no means complete, but it is currently the best available

A Note About Versions

sip has changed from version to version. I'm using python 2.2 and sip 3.0pre7. Depending on the verion you're using, sip will behave a little differently. The most notable addition to the new version of sip is support for classes that are wrapped inside namespaces.


ViM Syntax Script

Jonathan Gardner has written an incomplete sip syntax script. You can use it when you are writing a sip script with the ViM editor.

[http://vim.sourceforge.net/scripts/script.php?script_id=659]

Tutorials & additional docs staff

Googling the web on SIP tutorials brought up

SIP (last edited 2012-02-21 17:38:01 by S010600116e00f89a)

Unable to edit the page? See the FrontPage for instructions.