Re: [Open Babel] smarts matching using the command line

2011-09-26 Thread Martin Guetlein
On Mon, Sep 19, 2011 at 11:23 AM, Martin Guetlein < martin.guetl...@googlemail.com> wrote: > On Mon, Sep 19, 2011 at 11:04 AM, Chris Morley > wrote: > > On 19/09/2011 09:32, Martin Guetlein wrote: > >> Hi, > >> > >> I would like to do smarts matching with OpenBabel, and for some > >> reasons I am

[Open Babel] Fw: Interfacing C/C++ and Python with openbabel.py

2011-09-26 Thread Mingyue Zheng
Dear all, openbabel.py provides an interface to use python scripts to call C/C++ functions of open babel, in which C built-in datatypes are mapped into the closest Python equivalent. for example: int, long, short <---> Python integers. float, double <---> Python floats char, char * <---> Python

Re: [Open Babel] Fw: Interfacing C/C++ and Python with openbabel.py

2011-09-26 Thread Noel O'Boyle
Is there a reason you need to call GetString()? I would recommend that you work around the problem by storing the strings in the Python script along with the corresponding OBSmartsPattern? The underlying problem is that pointers to objects are not wrapped by the code. This is most easily fixed by

Re: [Open Babel] Fw: Interfacing C/C++ and Python with openbabel.py

2011-09-26 Thread Noel O'Boyle
Sorry - meant "GetSMARTS()" not "GetString()"... On 26 September 2011 17:10, Noel O'Boyle wrote: > Is there a reason you need to call GetString()? I would recommend that > you work around the problem by storing the strings in the Python > script along with the corresponding OBSmartsPattern? > > T

Re: [Open Babel] Fw: Interfacing C/C++ and Python with openbabel.py

2011-09-26 Thread Mingyue Zheng
Ok, the script I pasted is just an example and meaningless. I just want to know if there is any convenient way to unwrap a swig object like that, without changing the API. Thanks for your reply. 2011-09-27 Mingyue Zheng, Ph.D. Drug Discovery and

Re: [Open Babel] Fw: Interfacing C/C++ and Python with openbabel.py

2011-09-26 Thread Noel O'Boyle
After checking this some more, I found this (http://old.nabble.com/Printing-std%3Astring---return-param-in-python-td30668781.html), and saw that it should work for OB as it is returning a const reference to a std::string: const std::string& GetSMARTS() const The problem is that this seems to be sh

Re: [Open Babel] Fw: Interfacing C/C++ and Python with openbabel.py

2011-09-26 Thread Mingyue Zheng
Hi Noel, Great! Many thanks for your quick response and fix. Regards, Mingyue 2011-09-27 Mingyue Zheng, Ph.D. Drug Discovery and Design Center (DDDC) Box 1201, Shanghai Institute of Materia Medica. No. 555 Rd. Zuchongzhi, Shanghai, China Te