fetion for python