Language/Python

Ipython .. python 과 무엇이 다른가.

TechNote.kr 2015. 9. 14. 23:08
728x90

Ipython 이라는 것을 처음 접했을 때 Python 과 어떤 관계가 있는지 개념이 서지 않았다.




Overview

One of Python’s most useful features is its interactive interpreter. It allows for very fast testing of ideas without the overhead of creating test files as is typical in most programming languages. However, the interpreter supplied with the standard Python distribution is somewhat limited for extended interactive use.

[http://ipython.org/ipython-doc/3/overview.html]


Ipython은 python의 일종이다.


Ipython의 overview에 나와 있는 큰 두가지 목적은 다음과 같다.

-. comprehensive environment for interactive

=> 코드를 실행하면서 shell을 통해 현재의 코드와 대화를 할 수 있는 개념으로 이해했다.

-. exploratory computing 

=> 탐사의 컴퓨팅?, 단어만 봐서는 감이 잘 안오는데 병렬 컴퓨팅 이야기가 언급된 것으로 보아 많은 데이터를 기반으로 하나의 답을 찾아갈 때 사용하기 좋다라고 이해했는데, 적절한지 모르겠다.


위의 큰 2가지의 목적을 위해서 크게 3가지의 component를 지원한다.

  • An enhanced interactive Python shell.
  • A decoupled two-process communication model, which allows for multiple clients to connect to a computation kernel, most notably the web-based notebook
  • An architecture for interactive parallel computing.


An enhanced interactive Python shell

python 보다 더 interactive한 shell 제공해 python code를 작성하기에 매우 효율적이다.

예를 들면 다음과 같은 기능들이다.

tab key를 통해 자동 완성같은 기능.

실시간으로 object 내 확인,

system shell에 바로 접근해 system상의 command 실행 가능,

현재 session 동안 기존에 실행했던 command history 제공,

추가적으로 ipython 자체만의 command 제공.

 

Decoupled two-process model

Read-Evaluate-Print Loop (REPL) environment 는 전통적인 구조이다.

Ipython은 여기 구조에서 Evaluate를 분리했다. 분리한 Evaluate를 kernel 이라고 부른다.

이 kernel은 다른 부분들이랑 같이 실행할 수도 있지만 분리하여 실행할 수 도 있다. 


분리할 경우 미리 실행할 경우도 있는데 이 경우에는 --existing flag를 사용하여 해당 부분 skip을 할 수도 있다.


ipython console, ipython qtconsole, ipython notebook 을 보면 위와 같은 two process model을 확인할 수 있다.



- Interactive parallel computing

multicore CPU 와 같은 병렬 처리 구조의 HW들이 증가함에 따라 ipython도 이에 맞게 architecture를 가져오고 있다. 


728x90

'Language > Python' 카테고리의 다른 글

[02-1] Python - 변수 할당의 개념  (0) 2016.08.08
[02-3] Python - 문자열 (Strings)  (0) 2016.08.08
[02-2] Python - 숫자 (Numbers)  (0) 2016.08.07
[02-5] Python - 튜플 (tuple)  (0) 2016.08.07
[03-1] Python - if (조건문)  (0) 2016.08.01
pip 그리고 python library 설치.  (0) 2016.01.25
Python Chart, Graph library  (0) 2015.09.11
python excel xls xlsx  (0) 2015.08.09