Published: 08 May 2018 › Updated: 08 May 2018
코드 발췌하여 블로그에 넣기
오늘은 간단히 블로그에 코드를 삽입하는 것에 대해 알아보기로 한다.
물론 Ctrl+C, Ctrl+V 를 이용하여 붙여 넣을 수도 있지만 지저분해 보이기 쉽상이다.
그래서 다른 블로그 편집 시 사용하기도 하는 기술인 gist.github를 사용해 보기로 한다.
(1) 사이트에 접속해서 회원가입 한다 .
- 이미 github 계정이 있으면 그것과 연동이 되고, google 계정이 있으면 그걸 이용하는 것이 편할 것 같다.
(2) 붙여 넣을 코드 만들기
- 편집 모드에서 TextArea 에 붙여 넣는다.
- 저장하고 상단에 Embed 스크립트를 복사한다.
(3) 앞에서 복사한 스크립트를 아래와 같이 붙여 넣는다.
https://gist.github.com/swjo207/4939af673eca5652226be2dadeba2ad5.js
(4) 스팀잇의 경우에는 앞의 gist를 지원하지 않는다고 한다.
- 간단히 Markdown 문법을 이용하여 "```" 을 묶어서 편집한다.
import fnmatch
import os
rootPath = '/'
pattern = '*.mp3'
for root, dirs, files in os.walk(rootPath):
for filename in fnmatch.filter(files, pattern):
print( os.path.join(root, filename))
Leave 코드 발췌하여 블로그에 넣기 to:
Read more #code posts
Best Posts From philosymbol
We have not curated any of philosymbol's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.