Re: How to ignore the first line of the text read from a file

2008-08-30 Thread josh logan
On Aug 28, 3:47 am, Santiago Romero <[EMAIL PROTECTED]> wrote: > > I want to read text line-by-line from a text file, but want to ignore > > only the first line. I know how to do it in Java (Java has been my > > primary language for the last couple of years) and following is what I > > have in Pyth

Re: [Q] How to ignore the first line of the text read from a file

2008-08-28 Thread Steven D'Aprano
On Thu, 28 Aug 2008 15:11:39 -0700, Dennis Lee Bieber wrote: > On 28 Aug 2008 19:32:45 GMT, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >> On Thu, 28 Aug 2008 10:16:45 -0700, norseman wrote: >> > import os >> > >> > file = open(filename, 'r') >>

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread Terry Reedy
Santiago Romero wrote: I want to read text line-by-line from a text file, but want to ignore only the first line. I know how to do it in Java (Java has been my primary language for the last couple of years) and following is what I have in Python, but I don't like it and want to learn the better

Re: [Q] How to ignore the first line of the text read from a file

2008-08-28 Thread Marc 'BlackJack' Rintsch
On Thu, 28 Aug 2008 10:16:45 -0700, norseman wrote: > Benjamin Kaplan wrote: >> On Thu, Aug 28, 2008 at 12:11 AM, [EMAIL PROTECTED] < >> [EMAIL PROTECTED]> wrote: >> >>> Hello, >>> >>> I am new to Python and have one simple question to which I cannot find >>> a satisfactory solution. >>> I want t

Re: [Q] How to ignore the first line of the text read from a file

2008-08-28 Thread norseman
Benjamin Kaplan wrote: On Thu, Aug 28, 2008 at 12:11 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: Hello, I am new to Python and have one simple question to which I cannot find a satisfactory solution. I want to read text line-by-line from a text file, but want to ignore only the first lin

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread Paul Rubin
[EMAIL PROTECTED] writes: > If the OP needs line numbers elsewhere in the > code something like the following would work. > > infile = open(fileName, 'r') > for lineNumber, line in enumerate (infile): > # enumerate returns numbers starting with 0. > if lineNumber == 0: continue > print

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread rurpy
On Aug 27, 11:12 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 27 Aug 2008 21:11:26 -0700, [EMAIL PROTECTED] wrote: > > I want to read text line-by-line from a text file, but want to ignore > > only the first line. I know how to do it in Java (Java has been my > > primary langua

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread Chris
On Aug 28, 11:53 am, Ken Starks <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hello, > > > I am new to Python and have one simple question to which I cannot find > > a satisfactory solution. > > I want to read text line-by-line from a text file, but want to ignore > > only the first lin

Re: [Q] How to ignore the first line of the text read from a file

2008-08-28 Thread Paul Rubin
Ken Starks <[EMAIL PROTECTED]> writes: > LineList=open(filename,'r').readlines()[1,] You don't want to do that if the file is very large. Also, you meant [1:] rather than [1,] -- http://mail.python.org/mailman/listinfo/python-list

Re: [Q] How to ignore the first line of the text read from a file

2008-08-28 Thread Ken Starks
[EMAIL PROTECTED] wrote: Hello, I am new to Python and have one simple question to which I cannot find a satisfactory solution. I want to read text line-by-line from a text file, but want to ignore only the first line. I know how to do it in Java (Java has been my primary language for the last c

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread Santiago Romero
> I want to read text line-by-line from a text file, but want to ignore > only the first line. I know how to do it in Java (Java has been my > primary language for the last couple of years) and following is what I > have in Python, but I don't like it and want to learn the better way > of doing it.

Re: How to ignore the first line of the text read from a file

2008-08-28 Thread Chris
On Aug 28, 6:11 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hello, > > I am new to Python and have one simple question to which I cannot find > a satisfactory solution. > I want to read text line-by-line from a text file, but want to ignore > only the first line. I know how to do it in Jav

Re: [Q] How to ignore the first line of the text read from a file

2008-08-27 Thread Marc 'BlackJack' Rintsch
On Wed, 27 Aug 2008 21:11:26 -0700, [EMAIL PROTECTED] wrote: > I want to read text line-by-line from a text file, but want to ignore > only the first line. I know how to do it in Java (Java has been my > primary language for the last couple of years) and following is what I > have in Python, but I

Re: [Q] How to ignore the first line of the text read from a file

2008-08-27 Thread Benjamin Kaplan
On Thu, Aug 28, 2008 at 12:11 AM, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: > Hello, > > I am new to Python and have one simple question to which I cannot find > a satisfactory solution. > I want to read text line-by-line from a text file, but want to ignore > only the first line. I know how t

[Q] How to ignore the first line of the text read from a file

2008-08-27 Thread [EMAIL PROTECTED]
Hello, I am new to Python and have one simple question to which I cannot find a satisfactory solution. I want to read text line-by-line from a text file, but want to ignore only the first line. I know how to do it in Java (Java has been my primary language for the last couple of years) and followi