some tool code of python