내 Jupyter 노트에서 4 개의 공백 대신 2 개의 공백을 기본 들여 쓰기 크기로 사용하고 싶습니다. 어떻게해야합니까?Jupyter 노트북에서 들여 쓰기 크기를 어떻게 설정할 수 있습니까?
참고 :이 질문은 (감가 상각 된) IPython 노트북 및 (현재) Jupyter 노트북이 아니므로 How do I change the autoindent to 2 space in IPython notebook과 중복되지는 않습니다.
내 Jupyter 노트에서 4 개의 공백 대신 2 개의 공백을 기본 들여 쓰기 크기로 사용하고 싶습니다. 어떻게해야합니까?Jupyter 노트북에서 들여 쓰기 크기를 어떻게 설정할 수 있습니까?
참고 :이 질문은 (감가 상각 된) IPython 노트북 및 (현재) Jupyter 노트북이 아니므로 How do I change the autoindent to 2 space in IPython notebook과 중복되지는 않습니다.
이 작업을 수행하는 올바른 방법은 How do I change the autoindent to 2 space in IPython notebook에 bpirvu의 매장 대답입니다 :
그냥 ~/.jupyter/nbconfig/notebook.json
을 편집 할 수 있습니다. 여기에 관련 설정을 포함하는 완전한 notebook.json
입니다 : http://jupyter-notebook.readthedocs.io/en/latest/frontend_config.html을 다음 Jupyter 문서는이 주제에 부족하고 indentUnit
는 여기에 언급 아마 때문에, 웹의 주위에 더 유행의 더 해키 솔루션도 있습니다
{
"CodeCell": {
"cm_config": {
"indentUnit": 2
}
}
}
. 이 솔루션은 브라우저의 자바 스크립트 콘솔을 열고 당신을 위해 편집 ~/.jupyter/nbconfig/notebook.json
을 끝
var cell = Jupyter.notebook.get_selected_cell();
var config = cell.config;
var patch = {
CodeCell:{
cm_config:{indentUnit:2}
}
}
config.update(patch)
를 입력하는 것입니다.
두 번째 콘솔 솔루션을 사용하면 다음과 같은 오류가 발생합니다. Uncaught TypeError : config.update is not function; : 8 : 8; Meh. –
xtian