How to create a cumulative sum on update in mysql-python
Try this:

add_lang = ("INSERT INTO Languages (lang, length, counter)\ 
VALUES (%s, %s, 1)\ 
ON DUPLICATE KEY UPDATE\ 
counter = counter + 1,\ 
length = length + VALUES(length);")


NB: edited to apply parameter replacement to the VALUES