-1
저는 Python에서 초보자입니다. CMD에서이 명령을 실행하려고하면이 오류가 발생했습니다. . 알려 주시기 바랍니다 :return _compile (pattern, flags) .findall (string)과 관련된 오류 TypeError : 예상되는 문자열 또는 바이트 형 객체
코드 :
import re
handle=open('regex_sum_41718.txt')
for line in handle:
word=line.split()
print(type(word))
y=re.findall('[0-9]+',word)
print(y)
오류 :
Traceback (most recent call last):
File "Assi_1.py", line 5, in <module>
y=re.findall('[0-9]+', word)
File "D:\Python\lib\re.py", line 222, in findall
return _compile(pattern, flags).findall(string)
TypeError: expected string or bytes-like object
덕분에 많이.