[Biopython] [Entrez] bytes objects has no attribute 'read'
Peter Cock
p.j.a.cock at googlemail.com
Sun Dec 20 18:50:42 UTC 2015
On Sun, Dec 20, 2015 at 5:01 PM, <c.buhtz at posteo.jp> wrote:
> On 2015-12-19 23:11 Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> You need a handle-like object to give to the Biopython parser,
>> which must support the read method, so:
>>
>> h = z.open(z.namelist()[0])
>> for i in Bio.Entrez.parse(h):
>> print(i)
>
> Great that work.
> The open() function is not documented in the zipfile-package.
It is documented, although I did have to search the page carefully to find it:
https://docs.python.org/2/library/zipfile.html#zipfile.ZipFile.open
https://docs.python.org/3/library/zipfile.html#zipfile.ZipFile.open
Peter
More information about the Biopython
mailing list