Saturday, December 22, 2012

Python Errors and Exceptions


def saves(aFilePath, format):
    try:
        f = open(aFilePath, 'r+')
        for line in f:
            line.replace('\n','')
            if line:
                format(line)
        print "end of reading "+aFilePath
    except IOError as err:
        print err
        exit()

No comments:

Post a Comment