변수를 재할당하라고 하지만
(아래처럼 result에 결과값을 저장)
text = "abcde"
result = text.replace('abc','')
이래도 안될 경우에는 ! 대체할 문자열에 문제가 있을 수 있다.
나의 경우는 터키어를 바꾸려고 했었는데, 지원이 안되는 것 같다. (Ö)
다른 문자열로 테스트해보니 잘됨 ㅎㅎ
유니코드나 치환처리를 해줘야 사용가능할 것 같다 ! 일단은 split으로 대체하여 사용해야겠다.
(삽질 오래했넹..)
How can I replace Unicode characters with Turkish characters in a text file with Python
I am working on Twitter. I got data from Twitter with Stream API and the result of app is JSON file. I wrote tweets data in a text file and now I see Unicode characters instead of Turkish character...
stackoverflow.com
'Development > Python' 카테고리의 다른 글
[MySQL] 주별로 쿼리 조회 (0) | 2023.04.12 |
---|---|
[Python] lxml 설치 (0) | 2023.03.06 |
[Python] undetected_chromedriver 오류 해결 (0) | 2023.02.22 |
[Python] ERROR: command errored out with exit status 1 오류 (0) | 2023.02.06 |
[Python] centos6/7에 python3.7.9 설치 하기 (0) | 2023.01.30 |