Also have a look at Boost.Python:<br><br><a href="http://www.boost.org/doc/libs/1_44_0/libs/python/doc/index.html">http://www.boost.org/doc/libs/1_44_0/libs/python/doc/index.html</a><br><br><div class="gmail_quote">On Fri, Oct 15, 2010 at 11:29 PM, Paul <span dir="ltr">&lt;<a href="mailto:paulanon@gmail.com">paulanon@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi there,<br>
<br>
I&#39;ve been using C/C++ for many years (python, just reading about it).<br>
<br>
I have a software written in C/C++ but considering porting most of it<br>
to python, as it seems like it&#39;s a better choice for decision making<br>
portion of the code.  I&#39;m also thinking about having a &#39;matlab&#39; like<br>
interface for reading, processing, and writing.<br>
<br>
In my current C++ code, I would read data into a vector of structs<br>
(which contains other simple vectors, strings, and structs) and it can<br>
be as large as 500MB to 2GB.  The data gets processed (requires random<br>
access).  The result is then written out.<br>
<br>
I would like to make modules for python.  The problem is that the<br>
vector of structs that is very large.  First, is it possible to pass<br>
such structures around to and from python and C/C++?  What would be<br>
the overhead cost of having a large structure that needs to be passed<br>
to and from the C/C++ modules?<br>
<br>
# I imagine I&#39;d use the newly written software this way:<br>
&gt;&gt;&gt; import c_stuff  # my C/C++ module<br>
&gt;&gt;&gt; largestuff = c_stuff.read(file)  # read from disk<br>
&gt;&gt;&gt; c_stuff.process(largestuff, someparams1)  # processing, requires random access to the vector<br>
&gt;&gt;&gt; c_stuff.process(largestuff, someparams2)<br>
...<br>
&gt;&gt;&gt; c_stuff.process(largestuff, someparams10000) # the whole thing may take a few minutes to days<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; import python_stuff # some module written in python to process the data as well<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; python_stuff.process(largestuff, otherparams1)  # It&#39;s important that this data can be read (and I hope written) by python code<br>
&gt;&gt;&gt; python_stuff.process(largestuff, otherparams2)<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; c_stuff.write(largestuff) #write result<br>
<br>
Thank you in advance,<br>
<font color="#888888">Paul<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Sithembewena Lloyd Dube<br><a href="http://www.lloyddube.com">http://www.lloyddube.com</a><br>