Python AttributeError: module 'string' has no attribute 'atoi'

python2 中可以用string.atoi 在python3中会报错
替换的方案是

string.atoi(your_str)

替换为

int(your_str)

这个代码python2和python3都可以运行.

原文地址:https://www.cnblogs.com/vercont/p/10210149.html