PythonAttributeError: module 'string' has no attribute 'atoi'

mac2022-06-30  86

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

string.atoi(your_str)

替换为

int(your_str)

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

转载于:https://www.cnblogs.com/vercont/p/10210149.html

最新回复(0)