Once deleted, variables cannot be recovered. Proceed (y/[n])? y
1
%whos
Interactive namespace is empty.
1 2
# 모듈 호출 : import import dss
1
%whos
Variable Type Data/Info
------------------------------
dss module <module 'dss' from 'C:\\Code\\01_python\\dss.py'>
1
dss.num
1234
1
dss.disp1("python")
disp1 python
1
calc = dss.Calc()
1
calc.plus(1,2,3,4)
10
1
import random
1
random.randint(1, 5)
1
1
# 모듈 안에 특정 함수, 변수, 클래스 호출
1
from dss import num, disp2
1
%whos
Variable Type Data/Info
--------------------------------
calc Calc <dss.Calc object at 0x0000026C12554340>
disp2 function <function disp2 at 0x0000026C12626670>
dss module <module 'dss' from 'C:\\Code\\01_python\\dss.py'>
num int 1234
random module <module 'random' from 'C:<...>aconda3\\lib\\random.py'>
1
dss.num
1234
1
num
1234
1
%reset
Once deleted, variables cannot be recovered. Proceed (y/[n])? y
1
from dss import *
1
%whos
Variable Type Data/Info
--------------------------------
Calc type <class 'dss.Calc'>
disp1 function <function disp1 at 0x0000026C12626940>
disp2 function <function disp2 at 0x0000026C12626670>
num int 1234
grep: #: No such file or directory
grep: dss媛�: No such file or directory
grep: �뱾�뼱媛�: No such file or directory
grep: �뙣�궎吏�: No such file or directory
grep: �솗�씤: No such file or directory
ERROR: Pipe to stdout was broken
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='cp949'>
OSError: [Errno 22] Invalid argument
1 2 3 4 5
# 패키지 설치 # school $ python setup.py develop # 커널 리스타트 # develop : 개발자모드, 코드를 수정하면 설치된 패키지도 같이 수정 # build : 일반모드, 코드를 수정하면 다시 설치해야 수정된 코드가 적용
1
!pip list | grep dss
1
!pip list | grep numpy
numpy 1.19.2
numpydoc 1.1.0
1
from dss import *
1
%whos
Variable Type Data/Info
------------------------------
dss module <module 'school.dss.data1<...>\\school\\dss\\data1.py'>
np module <module 'numpy' from 'C:\<...>ges\\numpy\\__init__.py'>
packages SList ['__future__.py', '__phel<...>file.py', 'zipimport.py']
path str C:\Users\USER\.ipython
random module <module 'random' from 'C:<...>aconda3\\lib\\random.py'>
school module <module 'school' (namespace)>
sys module <module 'sys' (built-in)>
url module <module 'school.web.url' <...>on\\school\\web\\url.py'>
1
data1.plus(1,2)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-64-572e254ac59d> in <module>
----> 1 data1.plus(1,2)
NameError: name 'data1' is not defined