Added a function for python slider