2021년07월27일
Note
JavaScript
Array.prototype.map
사용시 필터 처리하기filter
사용 후 이어서map
사용하기flatMap
사용하기
- https://stackoverflow.com/questions/24806772/how-to-skip-over-an-element-in-map
Python
- 파일 읽기, 쓰기 with open('filename', 'r') as original: title = original.readline()with open('filename', 'r') as original: data = original.read()yaml = "---\ntitle:" + title.replace("#", "") + "\n" + "---\n"with open(root + "/" + file, 'w') as modified: modified.write(yaml + data)
- 현재 진행하고 있는 토이프로젝트에
.md
파일을 불러오고 있다. 기존에는 그냥 작성을 했는데 정보를 좀 더 정형화시키기 위해 YAML front matter를 추가해야 했다. 파일양이 155개 정도 되어서 일일이 하기 힘들어 Python 명령어로 처리하기 위해 구글링을 했다. https://stackoverflow.com/questions/4454298/prepend-a-line-to-an-existing-file-in-python
- 현재 진행하고 있는 토이프로젝트에
log
LINKS TO THIS PAGE
Edit this page
Last updated on 8/13/2022