사용자 도구

사이트 도구


ipython

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판이전 판
다음 판
이전 판
ipython [2016/08/19 03:09] rex8312ipython [2024/03/23 02:38] (현재) – 바깥 편집 127.0.0.1
줄 1: 줄 1:
 ====== IPython ====== ====== IPython ======
  
-===== ipython notebook 기본 figure size 변경 =====+===== Autoreload ===== 
 + 
 +  %load_ext autoreload 
 +  %autoreload 2 
 + 
 +===== ipython notebook 기본 설정 =====
  
 변경을 원하는 profile의 ipython_notebook_config.py 수정(없으면 생성) 변경을 원하는 profile의 ipython_notebook_config.py 수정(없으면 생성)
줄 7: 줄 12:
  
 <code python ipython_notebook_config.py> <code python ipython_notebook_config.py>
-# sample ipython_config.py 
 c = get_config() c = get_config()
  
-Subset of matplotlib rcParams that should be different for the inline backend.+외부에서 노트북 접속가능 
 +c.NotebookApp.ip = '*' 
 + 
 +# 기본 figure size 설정
 c.InlineBackend.rc = {'font.size': 10, 'figure.figsize': (10.0, 4.0), 'figure.facecolor': 'white', 'savefig.dpi': 72, 'figure.subplot.bottom': 0.125, 'figure.edgecolor': 'white'} c.InlineBackend.rc = {'font.size': 10, 'figure.figsize': (10.0, 4.0), 'figure.facecolor': 'white', 'savefig.dpi': 72, 'figure.subplot.bottom': 0.125, 'figure.edgecolor': 'white'}
 </code> </code>
줄 21: 줄 28:
 </code> </code>
  
 +예외가 발생하거나 사용자가 프로그램 실행 도중에 개입하고 싶을때 사용예
  
 +<code python>
 +from IPython import embed
 +import traceback
 +
 +...
 +while True:
 +  try:
 +    do_something()
 +  except KeyboardInterrupt:
 +    embed()
 +  except Exception as e:
 +    traceback.print_exc()
 +    embed()
 +
 +...
 +
 +</code>
 +
 +===== asyncio와 같이 사용 =====
 +
 +<code python>
 +%autoawait True
 +</code>
ipython.1471576172.txt.gz · 마지막으로 수정됨: 2024/03/23 02:37 (바깥 편집)