update python snippet