move to python3 and 让字符计算更精确

move to python3 and 让字符计算更精确