Skip to content

Commit 1ddd711

Browse files
author
hallymer
committed
add Package about "Python 파이썬 클래스 및 모듈, 패키지_03 파일" [ modify ]
패키지 구조 실습을 위한 파일들
1 parent e797c73 commit 1ddd711

5 files changed

Lines changed: 26 additions & 0 deletions

File tree

sub/__init__.py

Whitespace-only changes.

sub/sub1/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__all__ = ['module1']

sub/sub1/module1.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sys
2+
import inspect
3+
# from ..sub2 import module2
4+
5+
# module2.py
6+
def mod1_test1():
7+
print ("Module1 -> Test1")
8+
print("Path : ", inspect.getfile(inspect.currentframe()))
9+
10+
def mod1_test2():
11+
print ("Module1 -> Test2")
12+
print("Path : ", inspect.getfile(inspect.currentframe()))

sub/sub2/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__all__ = ['module2']

sub/sub2/module2.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import sys
2+
import inspect
3+
# from ..sub1 import module1
4+
5+
# module2.py
6+
def mod2_test1():
7+
print ("Module2 -> Test1")
8+
print("Path : ", inspect.getfile(inspect.currentframe()))
9+
10+
def mod2_test2():
11+
print ("Module2 -> Test2")
12+
print("Path : ", inspect.getfile(inspect.currentframe()))

0 commit comments

Comments
 (0)