Read A File Line by LIne





6
Date Submitted Fri. Aug. 18th, 2006 10:56 AM
Revision 1 of 1
Scripter ASmith
Tags python
Comments 2 comments
Reads a file line by line using Python in 3 lines

###
Description: Read a file line by line
URL: http://the.taoofmac.com/static/grimoire.html
Author:Unknown
License:Creative Commons License
###

import fileinput
for line in fileinput.input("/tmp/filename"):
    do_something(line)
 

Comments

Comments hmm..
Sat. Oct. 28th, 2006 8:21 PM    Newbie sk1p
  Comments hmm...
Thu. Nov. 2nd, 2006 3:59 PM    Newbie anthony

Voting