파일에서 많은 양의 텍스트를 잘라냅니다. 이제 청크는 변수에 저장됩니다. 마찬가지로,큰 문자열에서 행을 읽으십시오.
str="from child hood days i liked sweet and savoir. in the early days my mother cooked great deal of sweet meats in home and all my relatives had a nice taste for good sweets. even in remote assam town we thronged miles to procure good sweets. and my sweet eating habit was pretty known. in my childhood i could had as good as 30 to 40 rosgollas at one seating after a full course of lunch. though i was not among the best in my family."
하지만 지금 우리는
for line in file:
print line
내 질문으로 쓰기와 같은 방법으로 각 라인을 읽을 수는 우리가 이것을 할 수있는, 또는 내가 다시 파일에 다음 작성해야 수술 할까? 어떤 사람이 친절하게 도울 수 있다면.
감사합니다, Subhabrata 얀 배너 지 구르 가온 인도
각 라인을 읽고 싶다면, 그냥 파일에서 라인별로 라인을 읽어 보시기 바랍니다. – Sterling