티스토리 뷰
with open(filename) as f:
mylist = f.read().splitlines()
https://stackoverflow.com/questions/15233340/getting-rid-of-n-when-using-readlines
Getting rid of \n when using .readlines()
I have a .txt file with values in it. The values are listed like so: Value1 Value2 Value3 Value4 My goal is to put the values in a list. When I do so, the list looks like this: ['Value1\n', 'Value...
stackoverflow.com
'Python' 카테고리의 다른 글
| [conda] conda 업데이트 (0) | 2023.01.09 |
|---|---|
| [Python] Dict 예쁘게 출력하기 (0) | 2022.12.04 |
| linux pycocotools 설치시 ERROR: Failed building wheel for pycocotools 해결 (0) | 2022.11.17 |
| Anaconda 지원되는 python 버전 확인 명령어 (0) | 2022.11.08 |
| [Python] print 비활성화 (0) | 2022.10.09 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 이분탐색
- 백준 11437
- Lowest Common Ancestor
- FairMOT
- 백준
- 백준 11053
- 자료구조
- MOT
- 단축키
- 백준 1766
- ㅂ
- 인공지능을 위한 선형대수
- cosine
- 조합
- 백트래킹
- C++ Deploy
- 문제집
- 위상 정렬 알고리즘
- 가장 긴 증가하는 부분 수열
- 순열
- LCA
- PyCharm
- 파이참
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함
