The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.python
From: Nikhil <mnik...@gmail.com>
Date: Thu, 15 May 2008 00:22:35 +0530
Local: Wed, May 14 2008 2:52 pm
Subject: Re: readlines with line number support?
Arnaud Delobelle wrote: Oh I did not know enumerate can be used. Thanks Paul and Arnaud. > Nikhil <mnik...@gmail.com> writes: >> Hi, >> I am reading a file with readlines method of the filepointer object >> If there is none, do I have to end up using the counter in the loop? >> fp = open("file", "r") > The standard Python way is using enumerate() > for i, line in enumerate(fp): I will try this. You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||