(Python3로 변환) str에 바이트를 CONCAT 수 없습니다 그러나 나는 다음과 같은 오류를 수신하고 있습니다 :내가 Python3 내 파이썬 2 코드를 변환하기 위해 노력하고있어
문제는 루프이에Traceback (most recent call last):
File "markovtest.py", line 73, in <module>
get_all_tweets("quit_cryan")
File "markovtest.py", line 41, in get_all_tweets
outtweets = [(tweet.text.encode("utf-8") + str(b" ")) for tweet in alltweets]
File "markovtest.py", line 41, in <listcomp>
outtweets = [(tweet.text.encode("utf-8") + str(b" ")) for tweet in alltweets]
TypeError: can't concat bytes to str
:
나는 encode 매개 변수를 디코딩하거나 제거하기 위해 encode를 변경하려고했지만 완전히 이해할 수 없습니다. 어떤 도움을 주시면 감사하겠습니다.
추적 코드의 코드가 표시된 소스 코드와 일치하지 않기 때문에 2to3을 코드에서 실행하고 있습니까? – Blckknght