Possible Duplicate:
Reading a File into a Dictionary And Keeping Count파일에서 사전을 만들기 내가 두 값과 사전을 만들려고하고
: 첫 번째 값은 텍스트입니다 :
<NEW ARTICLE>
Take a look at
what I found.
<NEW ARTICLE>
It looks like something
dark and shiny.
<NEW ARTICLE>
But how can something be dark
and shiny at the same time?
<NEW ARTICLE>
I have no idea.
두 번째 값은 횟수의 수입니다 "ARTICLE"이라는 단어가 사용됩니다.
나는 다른 방법을 시도하고 하나의 방법은이 오류받은 : 나는 몇 가지 방법을 시도했지만 아무 소용이, 하나의 방법 I했습니다(key, val) = line.split()
ValueError: need more than 1 value to unpack
:
내가받는 erorr이입니다 시도해 보니 포장을 푸는 데 너무 많은 값이 주어졌습니다.
나중에 사전에서 키/단어를 검색하고 해당 개수를 찾고 싶습니다. 파이썬 3
같은 질문을 [h ere] (http://stackoverflow.com/questions/13115214/reading-a-file-into-a-dictionary-and-keeping-count). 반복적으로 같은 질문을하는 것이 바람직하지 않습니다. – inspectorG4dget