package1 package - 패키지 package 는 module과 __init__.py 파일이 있는 디렉토리다 python은 __init__.py 파일이 있는 디렉토리를 package로 취급한다 __init__.py 파일은 빈파일일 수도 있지만, package의 초기화 코드를 실행하거나, __all__변수를 정의할 수도 있다 __all__ = ["python_file1", ...] # 파일이름에 '.py' 가 붙지않음 실제파일이름은 python_file1.py 이다, 여기서 작성할 때는 .py를 붙이지 않는다 |-- package1 | |-- __init__.py | |-- file1.py 2020/09/18 - [Programming/Python] - module - 모듈 module - 모듈 python 에서 module 은 def .. 2020. 9. 21. 이전 1 다음