๐Ÿ“˜Python

Welcome to Python : ํŒจํ‚ค์ง€

4:Bee 2023. 7. 24. 22:44
728x90

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