Hi, I wrote this script to select some data from a csv file. Actually it writes it into a file but i would like to append it into an existing one to a specific line without removing existing code. does the open('filename.csv','a+') can do that?
here is the existing code: *import csv import sys def rawdata(): rawdata = [] catched = [] f = open('datalisting_000.csv','r')#the file to read to(!same path) try: reader = csv.reader(f) for row in reader: rawdata.append(row) finally: f.close() del rawdata[0] for elem in rawdata: ag = elem[0] ag.split(";") catched.append(ag) return catched def sendingraw(): ff = open('data.py','w')#the file to write to(!same path) ff.write(str(rawdata())) ff.close() sendingraw()* Cheers
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor