Post

반응형

inconsistent use of tabs and spaces in indentation in Python

inconsistent use of tabs and spaces in indentation in Python 에러는 탭이 아니라 띄어쓰기를 했을 경우에 발생한다. 겉보기에는 똑같지만 탭과 띄어쓰기는 다르니까 확인해보고 띄어쓰기나 탭을 지웠다가 다시 탭을 해보면 된다.

    print(line.text)
          ^^^^^^^^^
AttributeError: 'str' object has no attribute 'text'

AttributeError: 'str' object has no attribute 'text'

이건 line 안에 text가 없어서 나는 에러이다. 그냥 line을 써주면 된다.

반응형
▲ top