<br><br><div class="gmail_quote">On Sat, Mar 28, 2009 at 2:49 AM,  <span dir="ltr">&lt;<a href="mailto:jhaas@gwdg.de">jhaas@gwdg.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi all,<br>
<div class="im"><br>
&gt; I was aware of pymacs but I wanted something which is pythonic from the<br>
&gt; interface.<br>
</div>YAA - Yet Another Approach:<br>
<br>
I am using the boost.python libraries for python export (on a C++ project<br>
though,) and despite some complexity in the error messages usage is<br>
straightforward:</blockquote><div>I think for C++ boost.python is one of the best approaches. IMHO together with sip followed by swig. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

&gt; Also I wanted something which doesn&#39;t generate any dependencies and doesn&#39;t<br><div class="im">
&gt; add any complexity to the makefile.<br>
</div>That is a very good point, though I never used ctypes, at a first glance<br>
your code looks straightforward.<br>
I assume the difference is that ctypes calls functions from a library and<br>
swig/boost.python approaches allow access to global variables, ie allowing<br>
to construct a python shell for gmx as such?</blockquote><div>This is true. You can&#39;t access global variables.  <br></div><div> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


are there any cross-platform issues? it seems to run smoothly on OS X,<br>
linux and windows systems...</blockquote><div>not that I know of.  <br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><br>
&gt;This is why I chose to use ctypes.<br>
&gt;<br>
&gt; How many functions did you wrap with swig? Would it really be much more<br>
work<br>
&gt; to do it with ctypes? Can you upload you lib somewhere so we can take a<br>
look<br>
&gt; at the interface? The problem with the libs, I have seen so far which have<br>
&gt; been wrapped with swig, is that they keep the C interface. I think you only<br>
&gt; have half the advantage of using python if the interface is still C-like.<br>
I<br>
</div>one definitely should be able to do the usual python iterating through<br>
lists (and list comprehension) without needing to write an explicit export<br>
function</blockquote><div>Who shouldn&#39;t have to write it? The user of ther wrapper or the wrapper author?<br> </div><br>Roland<br></div><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov">cmb.ornl.gov</a><br>

865-241-1537, ORNL PO BOX 2008 MS6309<br>