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

mac2022-06-30  58

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

string.atoi(your_str)

替换为

int(your_str)

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

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

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)