<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Peter's Blog - Nodes for swig</title>
    <link>http://www.petersblog.org/</link>
    <description>Nodes containing the tag swig</description>
    <item>
      <title>WingIDE Python IDE</title>
      <link>http://www.petersblog.org/node/view/748</link>
      <description>&lt;p&gt;
I've been trying &lt;a href="http://www.wingide.com/"&gt;Wing IDE&lt;/a&gt; a development environment for &lt;a href="http://www.python.org"&gt;Python&lt;/a&gt;. I've tried some in the past and always fell back to using &lt;a href="http://www.vim.org"&gt;VIM&lt;/a&gt; and print statements: 
&lt;/p&gt;
&lt;dl&gt;&lt;dt&gt;IDLE&lt;/dt&gt;&lt;dd&gt;
cannot debug GUI applications (IDLEfork might, haven't tried it) 
&lt;/dd&gt;
&lt;dt&gt;PythonWin&lt;/dt&gt;&lt;dd&gt;
cannot debug GUI applications, doesn't appear to have evolved in the last few years 
&lt;/dd&gt;
&lt;dt&gt;Boa Constructor&lt;/dt&gt;&lt;dd&gt;
haven't tried it for a while, back then it was flaky and didn't work with the contemporary wxPython (which is a moving target anyway). Recent reports say the debugger is still flaky. 
&lt;/dd&gt;
&lt;dt&gt;pdb&lt;/dt&gt;&lt;dd&gt;
python's own debugger, command line based &lt;img alt="sad" src="/images/smileys/sad.png" /&gt; 
&lt;/dl&gt;&lt;/dd&gt;

&lt;p&gt;
I was interested in Wing IDE (WingIDE?) as it would be nice to have a decent debugger. Simple things like: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
double click exception stack dump to take me to point of exception in source 
&lt;/li&gt;
&lt;li&gt;
breakpoints (!) 
&lt;/li&gt;
&lt;li&gt;
single step 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
I tried the cheap 'personal' edition and here's a potted review: 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
on pentium 2 450M with 256M ram on windows XP it is very sluggish. It uses 40M of memory so it is probably swapping. On 1.5G Centrino with 512M it is much more useable. Single steps still take a second or so each (like walking through mud). When it runs the target the target runs at full speed. The help file makes mention of it being slow when it is loading symbols on startup but the slowness I see effects it all the time. 
&lt;/li&gt;
&lt;li&gt;
editor is ok in a Visual Studio kind of way. It's not VIM but I can still use VIM in the same way that I still use it with Visual Studio. Write code in VIM, correct it in IDE. 
&lt;/li&gt;
&lt;li&gt;
editor has auto-completion (fills in the rest of an identifier for you) but it's kinda slow to come up and VIM has a way to do this that is simplistic but useful (CTRL-N for the uninitiated). 
&lt;/li&gt;
&lt;li&gt;
first project I ran generated an exception in the startup code, something mysterious in &lt;a href="http://www.swig.org/"&gt;Swig&lt;/a&gt; generated code. Wing is supposed to intelligently tell the difference between exceptions that you trap yourself in your code and ones that you don't trap: presumably it only drops into the debugger on an unhandled exception. This particular exception was in the Swig stuff so it may have been under some C code, in which case the exception always stops in the debugger (in Wing terminology this is a 'false positive'). However, Wing has a useful option to learn which exceptions you want to always ignore so I set this up and was not bothered by it again. The details of the exception were presumably stored in the project file. 
&lt;/li&gt;
&lt;li&gt;
IDE and debugger works as you would expect from standards set by Turbo C 15 years ago. 
&lt;/li&gt;
&lt;li&gt;
in the personal edition, when the debugger comes in you cannot evaluate expressions or examine variables, you can only look at the values of variables in the stack trace. There is a python shell but it is independent from the script you are debugging so it is only useful for experiments. 
&lt;/li&gt;
&lt;li&gt;
from visual studio I am used to hovering the cursor over a variable name and seeing it's value in a tool tip, or being able to right click and see it's value. Wing does not do this, it seem you have to look through the stack trace to find the value of variable. 
&lt;/li&gt;
&lt;li&gt;
coolest feature is remote debugging. You can edit a script to add a line to import a Wing module and from then on, if the script raises an exception it will find the Wing IDE and you can start debugging. This is useful if, for example, you are debugging CGI scripts that are launched from Apache: the scripts can find Wing IDE and you can debug them, they don't have to be launched from Wing IDE itself. 
&lt;/li&gt;
&lt;li&gt;
it works fine debugging &lt;a href="http://www.wxpython.org"&gt;wxPython&lt;/a&gt; and has been solid so far. 
&lt;/li&gt;
&lt;li&gt;
I left it running a program for an hour. The program generated lots of print output which was caught and displayed in the debugger. After an hour the debugger was using over 100M of ram: it doesn't seem to want to limit the size of the debug buffer. Maybe there is an option to stop this but it's odd that it should do this by default. 
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
Conclusion: I can live with it's lethargy just to have a useable debugger. I'm still on the free trial, time will tell if I want to shell out $35 for the personal edition (less than &#163;20, not bad). 
&lt;/p&gt;
&lt;p&gt;
There are other open source alternatives I haven't looked at: 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://spe.pycs.net/"&gt;spe&lt;/a&gt;: looks like work in progress 
&lt;/p&gt;
&lt;p&gt;
 &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;: written in java, mainly for java 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/apache"&gt;apache&lt;/a&gt; &lt;a href="/tag/python"&gt;python&lt;/a&gt; &lt;a href="/tag/swig"&gt;swig&lt;/a&gt; &lt;a href="/tag/vim"&gt;vim&lt;/a&gt; &lt;a href="/tag/windows"&gt;windows&lt;/a&gt; &lt;a href="/tag/wingide"&gt;wingide&lt;/a&gt; &lt;a href="/tag/wxpython"&gt;wxpython&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/748</guid>
      <category domain="http://www.technorati.com/tag">apache</category>
      <category domain="http://www.technorati.com/tag">python</category>
      <category domain="http://www.technorati.com/tag">swig</category>
      <category domain="http://www.technorati.com/tag">vim</category>
      <category domain="http://www.technorati.com/tag">windows</category>
      <category domain="http://www.technorati.com/tag">wingide</category>
      <category domain="http://www.technorati.com/tag">wxpython</category>
    </item>
    <item>
      <title>Swig Howto</title>
      <link>http://www.petersblog.org/node/view/737</link>
      <description>&lt;p&gt;
A quick reminder on how to use &lt;a href="http://www.swig.org/"&gt;Swig&lt;/a&gt; under Windows XP to generate &lt;a href="http://www.python.org"&gt;Python&lt;/a&gt; modules with Visual Studio 6. 
&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
Download Windows version of Swig 
&lt;/li&gt;
&lt;li&gt;
Unzip it somewhere, I put it in c:/Python24/Swig 
&lt;/li&gt;
&lt;li&gt;
Create the following environment variables: 
&lt;div class="verbatim-block"&gt;&lt;pre&gt;PYTHONINCLUDE = c:\python24\include
PYTHONLIB = c:\Python24\Libs
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
Create a project in Visual Studio for a plain empty win32 dll. 
&lt;/li&gt;
&lt;li&gt;
In all build settings, make sure the following settings are added: 
&lt;div class="verbatim-block"&gt;&lt;pre&gt;Additional include directories = c:\python24\include
Additional library path = c:\python24\libs
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
Create swig definition file. Here is mine, it's for a CAN bus control module: 
&lt;pre class="lazy"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; %module pyCan
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; %include exception.i
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; %{
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; #include &amp;lt;windows.h&amp;gt;
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; #include &amp;lt;stdlib.h&amp;gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; #include &amp;lt;stdio.h&amp;gt;
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; #include &amp;lt;string.h&amp;gt;
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; #include &amp;quot;pyCan.h&amp;quot;
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt; %}
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt; /*
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt;  * When a c++ exception occurs, this code will turn it into
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt;  * a python exception. Cool.
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt;  */
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt; %exception {
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt;     try {
&lt;span class="line-numbers"&gt;  17 &lt;/span&gt;         $action
&lt;span class="line-numbers"&gt;  18 &lt;/span&gt;     } catch( char *strError) {
&lt;span class="line-numbers"&gt;  19 &lt;/span&gt;         PyErr_SetString(PyExc_RuntimeError, strError);
&lt;span class="line-numbers"&gt;  20 &lt;/span&gt;         return NULL;
&lt;span class="line-numbers"&gt;  21 &lt;/span&gt;     }
&lt;span class="line-numbers"&gt;  22 &lt;/span&gt; }
&lt;span class="line-numbers"&gt;  23 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  24 &lt;/span&gt; /*
&lt;span class="line-numbers"&gt;  25 &lt;/span&gt;  * The function GetRxPacket returns a new object that python
&lt;span class="line-numbers"&gt;  26 &lt;/span&gt;  * memory management must delete when required.
&lt;span class="line-numbers"&gt;  27 &lt;/span&gt;  */
&lt;span class="line-numbers"&gt;  28 &lt;/span&gt; %newobject GetRxPacket;
&lt;span class="line-numbers"&gt;  29 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  30 &lt;/span&gt; /*
&lt;span class="line-numbers"&gt;  31 &lt;/span&gt;  * Class that will become a python class. The python class will have
&lt;span class="line-numbers"&gt;  32 &lt;/span&gt;  * the same methods available.
&lt;span class="line-numbers"&gt;  33 &lt;/span&gt;  */
&lt;span class="line-numbers"&gt;  34 &lt;/span&gt; class pyCan {
&lt;span class="line-numbers"&gt;  35 &lt;/span&gt; public:
&lt;span class="line-numbers"&gt;  36 &lt;/span&gt;     pyCan( void);
&lt;span class="line-numbers"&gt;  37 &lt;/span&gt;     ~pyCan( void);
&lt;span class="line-numbers"&gt;  38 &lt;/span&gt;     void Initialise( void);
&lt;span class="line-numbers"&gt;  39 &lt;/span&gt;     void Poll( void);
&lt;span class="line-numbers"&gt;  40 &lt;/span&gt;     pyCanPacket *GetRxPacket( void);
&lt;span class="line-numbers"&gt;  41 &lt;/span&gt;     void TxPacket( int nID, PyObject *);
&lt;span class="line-numbers"&gt;  42 &lt;/span&gt; };
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
Add the Swig file to the project, right click and select 'settings'. Set the custom build commands something like the following: 
&lt;div class="verbatim-block"&gt;&lt;pre&gt;c:\python24\swig\swig -c++ -module pyCan -python c:\projects\694\src\pyCan\pyCan\pyCan.swig

Where

    -c++ = generate c++
    -module pyCan = output module is called 'pyCan
    -python = generate python module
    c:\projects\694\src\pyCan\pyCan\pyCan.swig = swig file name
&lt;/pre&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
The above will generate a c++ file called 'pyCan_wrap.cxx'. This should be put into the 'Outputs' box in the custom build step. 
&lt;/li&gt;
&lt;li&gt;
Run the build on the swig file to create the wrapper file pyCan_wrap.cxx and add that file to the project. 
&lt;/li&gt;
&lt;li&gt;
Set the link target to something like 
&lt;div class="verbatim-block"&gt;&lt;pre&gt;_pyCan.dll
&lt;/pre&gt;&lt;/div&gt;
I.e. the name of the module with an underscore in front. 
&lt;/li&gt;
&lt;li&gt;
Create a 'real' c++ header and implementation for your classes. They can be totally straight c++, e.g.: 
&lt;pre class="lazy"&gt;class pyCan {
public:
    pyCan( void);
    ~pyCan( void);
    void Initialise( void);
    void Poll( void);
    pyCanPacket *GetRxPacket( void);
    void TxPacket( int nID, PyObject *);
};
&lt;/pre&gt;
In the above example I am passing a PyObject * to the function TxPacket. This is because I want to be able to pass python strings that may contain null characters and I want access to both the pointer to the data and the data length, which the raw PyObject gives me. If I only wanted a char * I would simply put that in the argument. 
&lt;/li&gt;
&lt;li&gt;
Build it 
&lt;/li&gt;
&lt;li&gt;
Swig will create a file called 'pyCan.py' which is the python wrapper module that loads the dll. It is the file that your python must import. You might want to add a post-build step to copy this somewhere more useful. You may also put the link target file in the same directory or you will get errors when you import the module. 
&lt;/li&gt;
&lt;li&gt;
Write some python: 
&lt;pre class="lazy"&gt;&lt;span class="Keyword"&gt;import&lt;/span&gt; pyCan

o &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="MetaFunctionCallPy"&gt;pyCan.pyCan&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class="MetaFunctionCallPy"&gt;o.Initialise&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class="Keyword"&gt;while&lt;/span&gt; &lt;span class="Constant"&gt;1&lt;/span&gt;:
    &lt;span class="MetaFunctionCallPy"&gt;o.Poll&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
    r &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="MetaFunctionCallPy"&gt;o.GetRxPacket&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
    &lt;span class="Keyword"&gt;if&lt;/span&gt; r:
        &lt;span class="Keyword"&gt;print&lt;/span&gt; r
&lt;/pre&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;
Swig is quite easy to get going. I think it has real power but there is a lot of documentation to go through to fully understand what it can do and the documentation and semantics are not all that clear. The PyObject trick above was a guess of mine that happened to work. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/python"&gt;python&lt;/a&gt; &lt;a href="/tag/swig"&gt;swig&lt;/a&gt; &lt;a href="/tag/windows"&gt;windows&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/737</guid>
      <category domain="http://www.technorati.com/tag">python</category>
      <category domain="http://www.technorati.com/tag">swig</category>
      <category domain="http://www.technorati.com/tag">windows</category>
    </item>
    <item>
      <title>Python extension modules using Swig.</title>
      <link>http://www.petersblog.org/node/view/506</link>
      <description>&lt;p&gt;
Decided to write a python extension module. &lt;a href="http://www.swig.org/"&gt;Swig&lt;/a&gt; looks like the easiest way to do it. Given a simple definition file, e.g.: 
&lt;/p&gt;
&lt;div class="verbatim-block"&gt;&lt;pre&gt;%module mod552
extern int Wiffle( int a);
extern char *Poopie( char *strPoop);
extern int jetty( int a, char *strB);

%{
#include &amp;quot;Giblets.h&amp;quot;
%}

class Giblets
{
public:
  int Mandible( void);
};
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
Swig will generate a file full of c++ wrapper code for the python objects. The code for the library is written in straight C, e.g.: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; #include &amp;lt;string.h&amp;gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; #include &amp;lt;stdlib.h&amp;gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; #include &amp;quot;Giblets.h&amp;quot;
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; int Wiffle( int a)
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; {
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt;     return a + 5;
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; }
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; char *Poopie( char *strPoop)
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt; {
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt;     static char strBuff[1000];
&lt;span class="line-numbers"&gt;  13 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  14 &lt;/span&gt;     strcpy( strBuff, strPoop);
&lt;span class="line-numbers"&gt;  15 &lt;/span&gt;     strBuff[3] = 'p';
&lt;span class="line-numbers"&gt;  16 &lt;/span&gt;     strBuff[4] = 'c';
&lt;span class="line-numbers"&gt;  17 &lt;/span&gt;     strBuff[5] = 'w';
&lt;span class="line-numbers"&gt;  18 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  19 &lt;/span&gt;     return strBuff;
&lt;span class="line-numbers"&gt;  20 &lt;/span&gt; }
&lt;span class="line-numbers"&gt;  21 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  22 &lt;/span&gt; int jetty( int a, char *strB)
&lt;span class="line-numbers"&gt;  23 &lt;/span&gt; {
&lt;span class="line-numbers"&gt;  24 &lt;/span&gt;     return a + atoi( strB);
&lt;span class="line-numbers"&gt;  25 &lt;/span&gt; }
&lt;span class="line-numbers"&gt;  26 &lt;/span&gt; 
&lt;span class="line-numbers"&gt;  27 &lt;/span&gt; int Giblets::Mandible( void)
&lt;span class="line-numbers"&gt;  28 &lt;/span&gt; {
&lt;span class="line-numbers"&gt;  29 &lt;/span&gt;     return 97;
&lt;span class="line-numbers"&gt;  30 &lt;/span&gt; }
&lt;/pre&gt;
&lt;p&gt;
The module is used in python as you would expect: 
&lt;/p&gt;
&lt;pre class="lazy"&gt;&lt;span class="line-numbers"&gt;   1 &lt;/span&gt; C:\&lt;span class="InvalidIllegal"&gt;552\Src\Mod552\Mod552&amp;gt;python&lt;/span&gt;
&lt;span class="line-numbers"&gt;   2 &lt;/span&gt; Python &lt;span class="Constant"&gt;2.3&lt;/span&gt;.&lt;span class="Constant"&gt;4&lt;/span&gt; (&lt;span class="Comment"&gt;&lt;span class="Comment"&gt;#&lt;/span&gt;53, May 25 2004, 21:17:02) [MSC v.1200 32 bit (Intel)] on win32&lt;/span&gt;
&lt;span class="line-numbers"&gt;   3 &lt;/span&gt; Type &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;help&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;copyright&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;credits&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;or&lt;/span&gt; &lt;span class="String"&gt;&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;license&lt;span class="String"&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;span class="Keyword"&gt;for&lt;/span&gt; more information.
&lt;span class="line-numbers"&gt;   4 &lt;/span&gt; &lt;span class="Keyword"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt; &lt;span class="Keyword"&gt;import&lt;/span&gt; mod552
&lt;span class="line-numbers"&gt;   5 &lt;/span&gt; &lt;span class="Keyword"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt; &lt;span class="MetaFunctionCallPy"&gt;&lt;span class="Support"&gt;dir&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;mod552&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   6 &lt;/span&gt; [&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Giblets&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;GibletsPtr&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Poopie&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;Wiffle&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;__builtins__&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;__doc__&lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;, &lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;__file&lt;span class="InvalidIllegal"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   7 &lt;/span&gt; __&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;&lt;span class="Support"&gt;__name__&lt;/span&gt;&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;_mod552&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;_newclass&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;_object&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;_swig_getattr&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;_swig_seta
&lt;span class="line-numbers"&gt;   8 &lt;/span&gt; ttr&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;, &lt;span class="String"&gt;'&lt;/span&gt;&lt;/span&gt;jetty&lt;span class="String"&gt;&lt;span class="String"&gt;'&lt;/span&gt;]&lt;span class="InvalidIllegal"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;   9 &lt;/span&gt; &lt;span class="Keyword"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt; o &lt;span class="Keyword"&gt;=&lt;/span&gt; &lt;span class="MetaFunctionCallPy"&gt;mod552.Giblets&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  10 &lt;/span&gt; &lt;span class="Keyword"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt; &lt;span class="MetaFunctionCallPy"&gt;o.Mandible&lt;span class="MetaFunctionCallPy"&gt;(&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;&lt;/span&gt;&lt;span class="MetaFunctionCallPy"&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class="line-numbers"&gt;  11 &lt;/span&gt; &lt;span class="Constant"&gt;97&lt;/span&gt;
&lt;span class="line-numbers"&gt;  12 &lt;/span&gt; &lt;span class="Keyword"&gt;&amp;gt;&amp;gt;&lt;/span&gt;&lt;span class="Keyword"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;
&lt;a href="http://www.geocities.com/foetsch/python/extending_python.htm"&gt;This article&lt;/a&gt; is a useful introduction to the process although you have to be savvy with Visual C++ to follow it. 
&lt;/p&gt;&lt;p&gt;Related Posts: &lt;a href="/tag/python"&gt;python&lt;/a&gt; &lt;a href="/tag/swig"&gt;swig&lt;/a&gt;&lt;/p&gt;</description>
      <guid>http://www.petersblog.org/node/view/506</guid>
      <category domain="http://www.technorati.com/tag">python</category>
      <category domain="http://www.technorati.com/tag">swig</category>
    </item>
  </channel>
</rss>
