<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def count_lines_in_file(src_file ):
 """ test function. """

    tot = 0
    res = ''
    try:
        with open(src_file, 'r') as f:
            for line in f:
                tot += 1
            res = str(tot) + ' recs read'       
    except:
        res = 'ERROR -couldnt open file'
    return res