🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Jak zapisać wartości z pliku do słownika ?

#224
From: piter
Date: Thu, 05 Dec 2002 20:04
45 lines
2274 bytes
----- Original Message -----
From: "Adam Karpierz" <karpierz@_NOSPAM_alpha.pl>
Newsgroups: pl.comp.lang.python
Sent: Thursday, December 05, 2002 7:38 PM
Subject: Re: Jak zapisać wartości z pliku do słownika ?


> Użytkownik "piter" <tojopiter@yahoo.com> napisał:
>
> > > istream = file('nazwa_zbioru', 'rb')
> > > for line in istream:
> > ale to trza miec 2.2, nieprawdaz?
> > ja mam jeszcze 2.1 ;-(
>
> O czesc Slazoku :) Mosz juz robota ?
jeszcze nie ;-(

> Nie Piotrek, w 2.1 tez juz bylo
niezupelnie Adam, dopiero w 2.2 file object jest iteratorem i dlatego mozesz
go uzywac w: for line in fileObject

ActivePython 2.1.1, build 212 (ActiveState)
Python 2.1.1 (#20, Jul 26 2001, 11:38:51) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
>>> h=open("myfile")
>>> for l in h:
...     print l
...
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: loop over non-sequence
>>>


> W ogole sie lepiej przestawic bo pisza ze od 2.3 xreadlines beda
> deprec.. cus tam
a calkiem mozliwe

>
> Adam Karpierz
> karpierz@zope.pl
>
>
>
Technical Details
Message-ID: <asobg0$dlm$1@news.tpi.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!mimuw.edu.pl!news.mimuw.edu.pl!newsfeed.tpinternet.pl!news.tpi.pl!not-for-mail
References: <20021205173942.4f66e5c5.stoodi@wp.pl> <slrnauv2dn.lhf.jajcus@nic.bnet.pl> <aso2e3$h76$1@news.tpi.pl> <aso628$bpl$1@news.tpi.pl> <aso6ge$ejm$1@news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!pingwin.icm.edu.pl!news.icm.edu.pl!mimuw.edu.pl!news.mimuw.edu.pl!newsfeed.tpinternet.pl!news.tpi.pl!not-for-mail
From: "piter" <tojopiter@yahoo.com>
Newsgroups: pl.comp.lang.python
Subject: Re: Jak zapisać wartości z pliku do
 słownika ?
Date: Thu, 5 Dec 2002 21:04:40 +0100
Organization: tp.internet - http://www.tpi.pl/
Lines: 48
Message-ID: <asobg0$dlm$1@news.tpi.pl>
References: <20021205173942.4f66e5c5.stoodi@wp.pl> <slrnauv2dn.lhf.jajcus@nic.bnet.pl> <aso2e3$h76$1@news.tpi.pl> <aso628$bpl$1@news.tpi.pl> <aso6ge$ejm$1@news.tpi.pl>
Reply-To: "piter" <tojopiter@yahoo.com>
NNTP-Posting-Host: pb54.poznan.cvx.ppp.tpnet.pl
X-Trace: news.tpi.pl 1039118657 14006 213.76.73.54 (5 Dec 2002 20:04:17 GMT)
X-Complaints-To: usenet@tpi.pl
NNTP-Posting-Date: Thu, 5 Dec 2002 20:04:17 +0000 (UTC)
X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
X-MSMail-Priority: Normal
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit