Moving from perl to python: questions
Nathan Clegg
nathan at islanddata.com
Wed Feb 16 11:47:01 EST 2000
More information about the Python-list mailing list
Wed Feb 16 11:47:01 EST 2000
- Previous message (by thread): Moving from perl to python: questions
- Next message (by thread): Moving from perl to python: questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 16-Feb-2000 David R. Favor wrote: > 2) How to implement a no-frills file slurp() function import string def slurp(filename): print filename try: f = open(filename, 'r') # catch whichever exceptions you fancy, here # rstrip will strip all whitespace off the right side, # much like chomp lines = map(string.rstrip, f.readlines()) f.close return lines ---------------------------------- Nathan Clegg nathan at islanddata.com
- Previous message (by thread): Moving from perl to python: questions
- Next message (by thread): Moving from perl to python: questions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list