'Write important SGE stats to CSV file
Appends one line to the CSV'

def write_stats_to_csv(self, filename):

    bits = self.get_all_stats()
    try:
        f = open(filename, 'a')
        flat = (','.join((str(n) for n in bits)) + '\n')
        f.write(flat)
        f.close()
    except IOError as e:
        raise exception.BaseException(str(e))
