python script function for returning datas