On Mon, Apr 30, 2012 at 1:39 PM, Paul Emsley <paul.ems...@bioch.ox.ac.uk> wrote:
> On 30/04/12 08:39, Uwe Hoffmann wrote:
>> Hi,
>> Am 29.04.2012 16:19, schrieb Paul Emsley:
>>
>>> I am trying to write a C++ function to examine an RDKit::ROMol... but
>>> running it from a python script:
>>>
>>> m = Chem.MolFromSmilesString('Oc1ccccc1')
>>> do_cool_stuff(m)
>>>
>>> my C++ (which gets swigged) is:
>>>
>>> PyObject *do_cool_stuff(PyObject *pyo) {
>>>
>>>       RDKit::ROMol *mol = magic(pyo);
>> using a reference instead of pointer access:
>>
>> RDKit::ROMol&mol = boost::python::extract<RDKit::ROMol&>(m);
>>
>>
>
> Ah!  Magic!  Just what I wanted.
>
> (actually, I forgot that Greg was away, or I would have held back on
> sending this :-)

I'm glad you sent it while I *was* away! It would have taken me a
while to figure out the answer and it's great that Uwe got there
first. :-)
Thanks Uwe!

-greg

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to