0
모든 요소가 온라인 파일의 한 줄인 목록을 만들고 싶습니다. 그러나 목록을 분리하려면 EM을받습니다. "TypeError : 바이트와 같은 객체가 필요하며 'str'이 필요하지 않습니다. 나는 이미 decode ('utf8')로이 문제를 해결하려고 노력했지만 나는 할 수 없었다. 조언?목록 분할 : TypeError : 'str'이 아닌 바이트와 같은 객체가 필요합니다.
def collect_record(name):
file = "http://www.uniprot.org/uniprot/%s.txt" %name
u=urllib.request.urlopen(file)
pdblines=u.readlines()
for line in pdblines :
line = ligne.strip()
pdblines = line.split("b")
u.close()
return pdblines
당신은 당신의 게시물에 전체 역 추적을 추가해야합니다. 또한 코드에 오타가 있습니다. 'ligne.strip()'. [mcve]를 입력하십시오. –