apologies if I annoy and for spacing (google)
def csdInstrumentList(from_file): "Returns a list of .csd instruments and any comment lines after the instrument" infile = open(from_file, 'r') temp_number = 0 for line in infile: if 'instr' in line: s = re.split(r' +',line,3) instr_number = s[1] return instr_number I am coming pretty close to what I want with variations on theis but I cant seem to get 3 lines with the split and instr_number[array] = s[1] seems to give me an error. the data from the line I am trying to split in three would look like this instr 83 ;comment would be here I want comment returned in an array and instr_number returned in an array. -- http://mail.python.org/mailman/listinfo/python-list