Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #71744
| 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 | <vincent@vincentdavis.com> |
| 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 | <CALwzidmgde9jzE7=SOSPeYxYLPsn5cP_Kj89s6MSiOX3AwaBpg@mail.gmail.com> |
| References | <CALyJZZU9yJpTQZkL77uM+92TdW=UR=4n4oxmMFPXiF4mCr73+g@mail.gmail.com> <20140518213256.5a0f2d71@bigbox.christie.dr> <CALyJZZXyox2XjgBkomXuq0o5259GjwbzWyGeo_MhVrRJ_dGEYg@mail.gmail.com> <CALwzidmgde9jzE7=SOSPeYxYLPsn5cP_Kj89s6MSiOX3AwaBpg@mail.gmail.com> |
| From | Vincent Davis <vincent@vincentdavis.net> |
| Date | Sun, 18 May 2014 22:02:02 -0600 |
| Subject | Re: bz2.decompress as file handle |
| To | Ian Kelly <ian.g.kelly@gmail.com> |
| Content-Type | multipart/alternative; boundary=047d7b33d31e98fc7304f9b8d4de |
| Cc | Python <python-list@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.10122.1400472151.18130.python-list@python.org> (permalink) |
| 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 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
On Sun, May 18, 2014 at 9:44 PM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> You can just use bz2.open:
>
> >>> with bz2.open('test.txt.bz2', 'rt', encoding='ascii') as f:
> ... print(f.read())
>
Thanks I like that better then my solution.
Vincent Davis
720-301-3003
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: bz2.decompress as file handle Vincent Davis <vincent@vincentdavis.net> - 2014-05-18 22:02 -0600
csiph-web