with open(filename, 'rb') as csvFile:
    with tempfile:
        reader = csv.reader(csvFile, delimiter=',', quotechar='"')
writer = csv.writer(tempfile, delimiter=',', quotechar='"')
for row in reader:
    row[1] = row[1].title()
writer.writerow(row)
shutil.move(tempfile.name, filename)
Inline CSV File Editing with Python