Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- ajax
- object
- 비동기
- webpack
- setTimeout()
- JS #프로젝트
- Import
- sql
- Project
- 동기
- prj
- https://m.blog.naver.com/tt2t2am1118/221010125300
- 게임
- js
- json
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- slow and steady
- async
- eport
- 참고블로그
- database
- db
- Porject
- 혼프
- execCommand
- callback
- await
- mysql
- promise
- addEventListener
Archives
- Today
- Total
C-log
Welcome to Python : 패키지 본문
728x90
- 클래스 : https://hi-code.tistory.com/123
- 모듈 : https://hi-code.tistory.com/124
- 패키지 : https://hi-code.tistory.com/125
- 예외 처리 : https://hi-code.tistory.com/126
- 내장 함수 : https://hi-code.tistory.com/127
- 표준 라이브러리 : https://hi-code.tistory.com/128
- 외부 라이브러리 :https://hi-code.tistory.com/129
Title | Code | Console |
패키지 만들기 |
def echo_test(): print("echo")
|
|
import game.sound.echo game.sound.echo.echo_test()
|
echo | |
패키지 변수 및 함수 정의 |
# game/__init__.py
from .grahpic.render import render_test
VERSION = 3.5
def print_version_info():
print(f"The version of this game is {VERSION}.")
print("Initializing game...")
|
|
import game print(game.VERSION)
game.print_version_info()
|
3.5 The version of this game is 3.5. |
|
__all__ |
#game/sound/__init__.py __all__ = ['echo']
|
*다시 확인 필요 |
from game.sound import * echo.echo_test()
|
Initializing game... echo |
|
relative 패키지 |
# game/grahpic/render.py from ..sound.echo import echo_test
def render_test():
print("render")
echo_test()
|
|
from game.grahpic.render import render_test render_test()
|
Initializing game... render echo |
728x90
'📘Python' 카테고리의 다른 글
Welcome to Python : 내장 함수 (0) | 2023.07.25 |
---|---|
Welcome to Python : 예외처리 (0) | 2023.07.25 |
Welcome to Python : 모듈 (0) | 2023.07.24 |
Welcome to Python : 클래스 (0) | 2023.07.21 |
Welcome to Python : 프로그램의 입출력 (0) | 2023.07.13 |
Comments