Moving from perl to python: questions
Mikael Olofsson
mikael at isy.liu.se
Wed Feb 16 10:45:24 EST 2000
Hmm. Your indentation ended up corrupted here. I guess you meant:
def slurp(filename):
"Slurp all the lines of a file into an array"
print filename
try:
f = open(filename)
except IOError:
print "IOError: ", sys.exc_value
return None
return f.readlines()
/Mikael
-----------------------------------------------------------------------
E-Mail: Mikael Olofsson <mikael at isy.liu.se>
WWW: http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone: +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date: 16-Feb-00
Time: 16:42:29
This message was sent by XF-Mail.
-----------------------------------------------------------------------
More information about the Python-list
mailing list