On 06/21/2013 05:21 PM, Noel O'Boyle wrote:
> If it helps, the error message means that it's expecting a string as
> the filename variable, but you gave it something different (probably a
> list or a unicode string). Try printing out the result of type(sdf) to
> find out what it is.

Thank you. It was a unicode,

pybel.readfile("sdf", sdf.encode("ascii"), opt={ "canonical" : None } )

does the trick.

(The problem with unicode in python, "print sdf" won't tell you what you
need to know. Only "print type( sdf )" will, which I haven't tried before.)

Thanks again.
-- 
Dimitri Maziuk
Programmer/sysadmin
BioMagResBank, UW-Madison -- http://www.bmrb.wisc.edu

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
OpenBabel-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-discuss

Reply via email to