<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Please all change the title to just:<BR>
&nbsp;"Pyrex/ctypes/SWIG for wrapping image analysis"<BR>
&nbsp;<BR>
It is best to let Damian subscribe to the list and give you the blurb directly.<BR>
&nbsp;<BR>
Rgds,<BR>
Stephen<BR><BR>&gt; Date: Sat, 17 Jan 2009 21:59:43 -0800<BR>&gt; Subject: Re: Speaker for Feb/Mar/Apr [Pyrex/ctypes/SWIG for wrapping satellite image analysis for nuclear non-proliferation]<BR>&gt; From: <A href="mailto:damian.eads@gmail.com">damian.eads@gmail.com</A><BR>
&gt; To: spmcinerney@hotmail.com<BR>&gt; <BR>&gt; Stephen, please strike the satellite imagery and nuclear<BR>&gt; nonproliferation parts.&nbsp;<BR>
&gt;&nbsp;<BR>&gt; Thanks,<BR>&gt; <BR>&gt; Damian<BR>&gt; <BR>&gt; On Sat, Jan 17, 2009 at 9:19 PM, Stephen McInerney<BR>&gt; &lt;spmcinerney@hotmail.com&gt; wrote:<BR>&gt; &gt; I spoke with Damian Eads and he offers to give us an expanded version<BR>&gt; &gt; of his SciPy 08 talk for Pyrex/ctypes/SWIG for satellite image analysis for<BR>&gt; &gt; nuclear non-proliferation [link below]<BR>&gt; &gt; Not sure if Nathan or anyone else wanted to do a newbie nugget on this<BR>&gt; &gt; same topic that nght - could be good, I would encourage Nathan to.<BR>&gt; &gt;<BR>&gt; &gt; Jim or someone - can you mail out the list of our scheduled meeting dates<BR>&gt; &gt; for<BR>&gt; &gt; Feb-Mar-Apr at the new Symantec Mtn View location?<BR>&gt; &gt;<BR>&gt; &gt; Damian is based in New Mexico so let's see what fits his schedule.<BR>&gt; &gt;<BR>&gt; &gt; Regards,<BR>&gt; &gt; Stephen<BR>&gt; &gt;<BR>&gt; &gt; ________________________________<BR>&gt; &gt; From: spmcinerney@hotmail.com<BR>&gt; &gt; To: baypiggies@python.org<BR>&gt; &gt; Date: Mon, 29 Dec 2008 20:20:01 -0800<BR>&gt; &gt; CC: damian.eads@gmail.com<BR>&gt; &gt; Subject: Re: [Baypiggies] Opinions on Pyrex vs. ctypes vs. SWIG and whatever<BR>&gt; &gt; else binds to dynamic/shared libs<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; The "which wrapper to use?" design question was in fact one of the topics<BR>&gt; &gt; of Damian Eads' paper at this year's SciPy 2008:<BR>&gt; &gt; "First Time Experiences Using SciPy for Computer Vision Research"<BR>&gt; &gt; http://conference.scipy.org/static/wiki/eads-cv.pdf<BR>&gt; &gt;<BR>&gt; &gt; Not saying the paper was the definitive word on this subject, but<BR>&gt; &gt; I thought it was a good paper and an interesting and topical application<BR>&gt; &gt; area (satellite image analysis for nuclear non-proliferation) and a<BR>&gt; &gt; SciPy newbie case study.<BR>&gt; &gt;<BR>&gt; &gt; I suggested we should invite Damian to present at BayPIGgies sometime,<BR>&gt; &gt; any comments?<BR>&gt; &gt;<BR>&gt; &gt; In fact, many folks have experience on this question, it would make a great<BR>&gt; &gt; topic for a presentation by multiple users sharing their viewpoints for<BR>&gt; &gt; different<BR>&gt; &gt; domains (I haven't done this stuff so I can't comment myself;<BR>&gt; &gt; The consensus answer as far as I can see seems to depend largely<BR>&gt; &gt; on how robust and stable the wrapperized code is, how much type-safety<BR>&gt; &gt; you need, exception-handling, how much control or visibility you have over<BR>&gt; &gt; the underlying source etc...)<BR>&gt; &gt;<BR>&gt; &gt; Stephen<BR>&gt; &gt;<BR>&gt; &gt;&gt; From: nar@hush.com<BR>&gt; &gt;&gt; To: baypiggies@python.org<BR>&gt; &gt;&gt; Date: Mon, 29 Dec 2008 12:23:43 -0800<BR>&gt; &gt;&gt; Subject: [Baypiggies] Opinions on Pyrex vs. ctypes vs. SWIG and whatever<BR>&gt; &gt;&gt; else binds to dynamic/shared libs<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Hi guys,<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Long time lurker, first time poster -- I've got a question that has<BR>&gt; &gt;&gt; been bugging me for a while and I figured I'd roll it out here to see<BR>&gt; &gt;&gt; what opinions people may have.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; I've done a bit of work with Python binding to DLLs on Windows and<BR>&gt; &gt;&gt; shared libraries on Linux/OSX, but I've mostly taken the ctypes route<BR>&gt; &gt;&gt; using GCC-XML to generate wrapper code for me. It would seem that most<BR>&gt; &gt;&gt; cheese shop modules use Pyrex with hand coded wrappers or SWIG to half<BR>&gt; &gt;&gt; auto-gen the wrappers and finish off with hand fix-ups.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Since ctypes ships with Python I kind of assumed it would be the<BR>&gt; &gt;&gt; 'default' way of performing this task, but most people seem to like<BR>&gt; &gt;&gt; Pyrex and a minority of people seem to use SWIG but hate it.<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; I suspect the question is similar to asking 'Which is better, vi or<BR>&gt; &gt;&gt; emacs?', but I'd like to hear what other people are doing / have done<BR>&gt; &gt;&gt; and why they prefer it?<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; For those unfamiliar with ctypes / ctypeslib here's the process:<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; 0) Install gccxml<BR>&gt; &gt;&gt; 1) Install ctypeslib module if it's not on your system, this will put<BR>&gt; &gt;&gt; h2xml.py and xml2py.py on your system<BR>&gt; &gt;&gt; 2) h2xml.py -I/path/to/includes SomeIncludeFile.h -o SomeIncludeFile.xml<BR>&gt; &gt;&gt; 3) xml2py.py SomeIncludeFile.xml -o NewPythonModule.py<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; There's a bit of fiddling you can do with the h2xml stuff as far as<BR>&gt; &gt;&gt; preprocessing, but that's roughly what it takes. You still need to<BR>&gt; &gt;&gt; hand-fix the generated wrapper code to make it 'pythonic' if thats<BR>&gt; &gt;&gt; your flavor, since it passes C-type variables in and out, but it still<BR>&gt; &gt;&gt; seems like a better development flow than using Pyrex/SWIG, but there<BR>&gt; &gt;&gt; may be factors I'm unaware of. (Which is why I'm asking here!)<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Hopefully this isn't too off topic for the list, I look forward to the<BR>&gt; &gt;&gt; responses,<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Thanks!<BR>&gt; &gt;&gt;<BR>&gt; &gt;&gt; Nathan Ramella<BR>&gt; &gt;&gt; nar &lt;&gt; @ &lt;&gt; hush.com<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ________________________________<BR>&gt; &gt; It's the same Hotmail(R). If by "same" you mean up to 70% faster. Get your<BR>&gt; &gt; account now.<BR>&gt; &gt;<BR>&gt; &gt; ________________________________<BR>&gt; &gt; Windows Live™: Keep your life in sync. Check it out.<BR><BR><br /><hr />Windows Live™ Hotmail®: Chat. Store. Share. Do more with mail.  <a href='http://windowslive.com/howitworks?ocid=TXT_TAGLM_WL_t1_hm_justgotbetter_howitworks_012009' target='_new'>See how it works.</a></body>
</html>