🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.lang.python
Article #27105

Re: Kodowanie stringu pod windows i linux

#27105
From: William Bonawentura
Date: Wed, 30 Dec 2009 07:03
13 lines
1470 bytes
Użytkownik "Gallus Anonimus" <gallusnnms@na_gmailu.com> napisał w wiadomości 
news:sdl3j59muoire1dn8qhohhld9e8u98pfid@4ax.com...
>
> import codecs
> f = codecs.open("plik.txt","r","utf-8")
> txt = f.read()
> f.close()
>

import codecs
with codecs.open("plik.txt","r","utf-8") as f:
    txt = f.read()
Technical Details
Message-ID: <hhetvv$o5f$1@news2.ipartners.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news2.ipartners.pl!not-for-mail
References: <f20bf1d1-7b95-4134-8480-402e8cf72630@a32g2000yqm.googlegroups.com> <d38ff7b6-eef8-4952-a1c8-183d3b9e432d@v13g2000yqk.googlegroups.com> <7d25fecc-0503-401e-aa9c-ca2764689842@d10g2000yqh.googlegroups.com> <sdl3j59muoire1dn8qhohhld9e8u98pfid@4ax.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news2.ipartners.pl!not-for-mail
From: "William Bonawentura" <news@ipartners.pl>
Newsgroups: pl.comp.lang.python
Subject: Re: Kodowanie stringu pod windows i linux
Date: Wed, 30 Dec 2009 08:03:26 +0100
Organization: GTS Energis
Lines: 14
Message-ID: <hhetvv$o5f$1@news2.ipartners.pl>
References: <f20bf1d1-7b95-4134-8480-402e8cf72630@a32g2000yqm.googlegroups.com>  <d38ff7b6-eef8-4952-a1c8-183d3b9e432d@v13g2000yqk.googlegroups.com> <7d25fecc-0503-401e-aa9c-ca2764689842@d10g2000yqh.googlegroups.com> <sdl3j59muoire1dn8qhohhld9e8u98pfid@4ax.com>
NNTP-Posting-Host: nat-coig130.coig.katowice.pl
Mime-Version: 1.0
X-Trace: news2.ipartners.pl 1262156607 24751 195.39.217.130 (30 Dec 2009 07:03:27 GMT)
X-Complaints-To: abuse@ipartners.pl
NNTP-Posting-Date: 30 Dec 2009 07:03:27 GMT
In-Reply-To: <sdl3j59muoire1dn8qhohhld9e8u98pfid@4ax.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005
X-Newsreader: Microsoft Windows Mail 6.0.6002.18005
X-MSMail-Priority: Normal
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit