Notice
														
												
											
												
												
													Recent Posts
													
											
												
												
													Recent Comments
													
											
												
												
													Link
													
											
									| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 | 
| 12 | 13 | 14 | 15 | 16 | 17 | 18 | 
| 19 | 20 | 21 | 22 | 23 | 24 | 25 | 
| 26 | 27 | 28 | 29 | 30 | 31 | 
													Tags
													
											
												
												- Linux
- 날짜
- sqlite
- swift
- GIT
- 라즈베리파이
- ASP
- 다이어트
- 맛집
- node.js
- 유니티
- python
- port
- tensorflow
- IOS
- PyQt5
- MS-SQL
- javascript
- 리눅스
- ubuntu
- urllib
- 함수
- flutter
- Unity
- PER
- MySQL
- Excel
- pandas
- PyQt
- mssql
													Archives
													
											
											
											
											아미(아름다운미소)
[ 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