Re: [Tutor] how to get a line text from input file.

2006-03-22 Thread Alan Gauld
> i am new to programming language and python. I wonder how to get a line > text > from input file. f = open('somefile.txt') line = f.readline() For more details on using files see the Handling Files topic in my web tutor. Alan G Author of the learn to program web tutor http://www.freenetpages

Re: [Tutor] how to get a line text from input file.

2006-03-21 Thread Danny Yoo
On Wed, 22 Mar 2006, Keo Sophon wrote: > i am new to programming language and python. I wonder how to get a line > text from input file. Hi Sophon, You may want to look at: http://wiki.python.org/moin/BeginnersGuide/NonProgrammers Many of the tutorials there talk about reading from files

Re: [Tutor] how to get a line text from input file.

2006-03-21 Thread Kent Johnson
Keo Sophon wrote: > Hi all, > > i am new to programming language and python. I wonder how to get a line text > from input file. The simplest Python idiom to do something with each line of a file is this: for line in open('somefile.txt'): # do something with line You can find out more he

[Tutor] how to get a line text from input file.

2006-03-21 Thread Keo Sophon
Hi all, i am new to programming language and python. I wonder how to get a line text from input file. Thanks, sophon ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor