Some python codes