Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/b/i/biopython-1.63/Bio/bgzf.py   biopython(Download)
 
from Bio._py3k import _as_bytes, _as_string
from Bio._py3k import open as _open
 
#For Python 2 can just use: _bgzf_magic = '\x1f\x8b\x08\x04'
            or "a" in mode.lower():
                raise ValueError("Must use read mode (default), not write or append mode")
            handle = _open(filename, "rb")
        self._text = "b" not in mode.lower()
        if self._text:
                raise ValueError("Must use write or append mode, not %r" % mode)
            if "a" in mode.lower():
                handle = _open(filename, "ab")
            else:
                handle = _open(filename, "wb")

src/b/i/biopython-HEAD/Bio/bgzf.py   biopython(Download)
 
from Bio._py3k import _as_bytes, _as_string
from Bio._py3k import open as _open
 
#For Python 2 can just use: _bgzf_magic = '\x1f\x8b\x08\x04'
            or "a" in mode.lower():
                raise ValueError("Must use read mode (default), not write or append mode")
            handle = _open(filename, "rb")
        self._text = "b" not in mode.lower()
        if self._text:
                raise ValueError("Must use write or append mode, not %r" % mode)
            if "a" in mode.lower():
                handle = _open(filename, "ab")
            else:
                handle = _open(filename, "wb")