Pyton错误“ AttributeError模块'string'没有属性'lstrip'”

时间:2019-12-05 23:46:23

标签: python python-3.x string

启动此代码时,我无法保存在网站上找到的文件。我收到一个错误“ AttributeError模块'string'没有属性'lstrip'” 我无法用“ string.lstpri”解决问题,帮助我找到错误?

PyRef

1 个答案:

答案 0 :(得分:-1)

Andrej Kesely gave the solution in a comment

  

filesave = string.lstrip(fileName, '/')应该为filesave = fileName.lstrip('/') string是您之前导入的模块的名称