Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.032 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'subject:file': 0.07; 'subject:skip:b 10': 0.07; 'cc:addr:python-list': 0.11; 'wrote:': 0.18; 'solution.': 0.20; '>>>': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; '>>>': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'received:209.85': 0.35; 'received:google.com': 0.35; 'received:209': 0.37; 'pm,': 0.38; 'ian': 0.60; 'to:addr:gmail.com': 0.65; 'subject:handle': 0.84 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=at+XCkt3vfVmd9QxqpennZsttcs2mRymZPM1/3TZwBI=; b=JAj8WkE7d1cHtbx6GD9Td6eMxuI+GFaypOQN7O6W/zsfF3NR2XknfCjv+sayaaed6j nFOFCc/N6pSLtSPZLYXZ6ocM5lPpWFHS2hSKlCPuhAKydiv5bvKL05J89chS33z6g2Wz FIn5T5cdGCADqjraEGhTZLKGQp7Gh3OvDHSHwVeZUII0wcwx7qMxz1ax2IknRqgC64z5 +WPpX9X2zrsqqTeLjMtsinBBG9/pdjxJiqBTUVPxam6Hyz0fHSGY2TOL3pW3mYjlNTUU 5qMOQ1HWkaWgWKRr+3y5Z08xYQQ8zrYF1yunWEd4tgXb5GjzbZ9OblpiSKaapKlSRGtc MVZA== X-Gm-Message-State: ALoCoQm0fPXPQEaGxSjLkZKyVewYsQVA7xg1FxvP2/V7sNobnBZkA79xwXlb5et0DvBNbzLSJ4eV X-Received: by 10.60.92.170 with SMTP id cn10mr192586oeb.76.1400472142912; Sun, 18 May 2014 21:02:22 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20140518213256.5a0f2d71@bigbox.christie.dr> From: Vincent Davis Date: Sun, 18 May 2014 22:02:02 -0600 Subject: Re: bz2.decompress as file handle To: Ian Kelly Content-Type: multipart/alternative; boundary=047d7b33d31e98fc7304f9b8d4de Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 44 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1400472151 news.xs4all.nl 2951 [2001:888:2000:d::a6]:44789 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:71744 --047d7b33d31e98fc7304f9b8d4de Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Sun, May 18, 2014 at 9:44 PM, Ian Kelly wrote: > You can just use bz2.open: > > >>> with bz2.open('test.txt.bz2', 'rt', encoding=3D'ascii') as f: > ... print(f.read()) > =E2=80=8BThanks I like that better then my solution. =E2=80=8B Vincent Davis 720-301-3003 --047d7b33d31e98fc7304f9b8d4de Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

= On Sun, May 18, 2014 at 9:44 PM, Ian Kelly <ian.g.kelly@gmail.com&= gt; wrote:
You can just use bz2.open:

>>> with bz2.open('test.txt.bz2', 'rt', encoding= =3D'ascii') as f:
... =C2=A0 =C2=A0 print(f.read())

= =E2=80=8BThanks I like that better then my solution.
=E2=80=8B


Vincent Davis
720-= 301-3003
--047d7b33d31e98fc7304f9b8d4de--