<aside> 💡 패키지는 폴더와 같은 형태로 모듈, 라이브러리 등을 묶은 것입니다.
</aside>

__init__.py : 패키지를 import 할 때 필요
greetings.py
def hello_to(name):
return f"안녕하세요, {name}님!"
def bye_to(name):
return f"{name}님, 안녕히 가세요."
version = "1.0" # 모듈의 버전 표시
arithmetics.py
def add(x, y):
return x + y
def subtract(x, y):
return x - y
def multiply(x, y):
return x * y
def divide(x, y):
return x / y
# 비공개
def _rest(x, y):
return x % y
main.py
from myutils import greetings, arithmetics
hello_to_cheolsu = greetings.hello_to("철수")
add_3_4 = arithmetics.add(3, 4)
pass
아래처럼 임포트도 가능
main.py