Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
[ python] Extract sentences with specific words in a text file 본문
python텍스트파일에서 특정 단어가 사용된 문장 추출하기
code = "찿는문자"
document_text = open('sell_list.txt', 'r', encoding='utf-8')
text_string = document_text.read()
search = code
if search in text_string:
print("Ok")
else:
print("NONE")
document_text.close()
'랭귀지 > python' 카테고리의 다른 글
| python "No module win32com.client"오류 발생시 (0) | 2018.10.08 |
|---|---|
| python 정규식 표현 중 자주 사용되는 패턴 (0) | 2018.10.07 |
| python 필요없는 문자, 특수문자, 공백 제거는 정규식 (0) | 2018.10.04 |
| Python Named colors in matplotlib (0) | 2018.10.03 |
| Python 슬라이싱으로 문자열 나누기 (0) | 2018.10.02 |
Comments