Paolo provided the answer, I will fix the docs. :-) -greg
On Tue, Oct 15, 2019 at 11:12 PM Paolo Tosco <paolo.tosco.m...@gmail.com> wrote: > Dear Jean-Marc, > > in Python 3 you need to use next(suppl) or suppl.__next__(). > > Cheers, > p. > > On 10/15/19 21:34, Jean-Marc Nuzillard wrote: > > Dear all, > > The code: > > from rdkit import Chem > sdfnamein = "simple.sdf" > suppl = Chem.SDMolSupplier(sdfnamein) > m = suppl.next() > print(m.GetNumAtoms()) > > prints: > > Traceback (most recent call last): > File "demo.py", line 4, in <module> > m = suppl.next() > AttributeError: 'SDMolSupplier' object has no attribute 'next' > > even though the code in > http://www.rdkit.org/docs/source/rdkit.Chem.rdmolfiles.html#rdkit.Chem.rdmolfiles.SDMolSupplier > , > at paragraph "Lazy evaluation 2" indicates: > > >>> suppl = SDMolSupplier('in.sdf')>>> mol1 = suppl.next() > > I run rdkit 2018.09.1.0 from Anaconda in Windows 10. > > for mol in suppl: mol.GetNumAtoms() > > works fine. > > Best, > > Jean-Marc > > -- > > Dr. Jean-Marc Nuzillard > Institute of Molecular Chemistry, CNRS UMR 7312 > Faculté des Sciences Exactes et Naturelles, Bâtiment 18 > BP 1039 > 51687 REIMS Cedex 2 > France > > Tel : 33 3 26 91 82 10 > Fax : 33 3 26 91 31 > 66http://www.univ-reims.fr/icmrhttp://eos.univ-reims.fr/LSD/CSNteam.html > http://www.univ-reims.fr/LSD/http://www.univ-reims.fr/LSD/JmnSoft/ > > > > > > _______________________________________________ > Rdkit-discuss mailing > listRdkit-discuss@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/rdkit-discuss > > > _______________________________________________ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss >
_______________________________________________ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss