모 ¶
모란? ¶
- 로그램 C
- 로그램(, 래... )과 데를
- 가 모 된 나 변 록 는것 ( = 라브러리)
모 까? ¶
- 드를 다.
- 모든것 모단로 리되 다.
- 공 다른 모과 겹 기 때문 독립 가능다.
모만들기(단게..) ¶
~cpp c = 2 def add(a, b): return a+b def mul(a, b): return a*b
mymath.py 라는 로 다..
~cpp >>> import mymath >>> dir(mymath) ['__builtins__', '__doc__', '__file__', '__name__', 'add', 'c', 'mul'] >>> mymath <module 'mymath' from 'C:\Python22\mymath.py'> >>> >>> mymath.c 2 >>> mymath.add <function add at 0x00A927E0> >>> mymath.add(3,4) 7 >>> mymath.mul(4,6) 24
공 ¶
- 공 = 되는 공
- 격변 = ddd.sss 같 공 명 나나 는 변.
- 무격변 = ktf 같 공 명 변.
공, 공 ¶
globals(), locals()
~cpp a = 1 b = 2 def f(): localx = 10 localy = 20 print '변:', globals() print '변:', locals() f() print '모 변:', globals() print '모 변:', locals()
력값
~cpp 변 a,b 변 localx,localy 래 두개는.. a,b,f()
모 공 보기 ¶
떠 고 는가...
~cpp >>> import string >>> dir(string) ['_StringTypes', '__builtins__', '__doc__', '__file__', '__name__', '_float', '_idmap', '_idmapL', '_int', '_long', 'ascii_letters', 'ascii_lowercase', 'ascii_uppercase', 'atof', 'atof_error', 'atoi', 'atoi_error', 'atol', 'atol_error', 'capitalize', 'capwords', 'center', 'count', 'digits', 'expandtabs', 'find', 'hexdigits', 'index', 'index_error', 'join', 'joinfields', 'letters', 'ljust', 'lower', 'lowercase', 'lstrip', 'maketrans', 'octdigits', 'printable', 'punctuation', 'replace', 'rfind', 'rindex', 'rjust', 'rstrip', 'split', 'splitfields', 'strip', 'swapcase', 'translate', 'upper', 'uppercase', 'whitespace', 'zfill']
모 공기 ¶
~cpp 무길다..보..!! import string string.__dict__
공 갖는것들 ¶
- 모, , 래 ..
- 부 값 가능..
~cpp >>> string.b Traceback (most recent call last): File "<pyshell#17>", line 1, in ? string.b AttributeError: 'module' object has no attribute 'b' >>> string.b=2 >>> string.b 2