Saturday, August 08, 2009

Reading a text file in Python

f = open('/etc/passwd', 'r')

for line in f.readlines():
print line,

f.close()

No comments: