pythonパッケージ_all__
1669 ワード
main.pyはsendmsgを採用する.test1()
#receive.py
def test2():
print("-----recvmsg-test2---")
#sendmsg.py
def test1():
print("----sendmsg-test1-----")
#__init__.py
__all__ = ["sendmsg"]
#main.py
''' Testmsg ,Testmsg sendmsg.py、recive.py __init__.py
__init__.py, __init__.py '''
from TestMsg import *
sendmsg.test1()# sendmsg.py test1
main.pyはTestmsgを採用する.sendmsg.test1()
#__init__.py
__all__ = ["sendmsg"]
from TestMsg import * # TestMsg , __all__ sendmsg sendmsg
#from . import recvmsg # recvmsg
#main.py
''' Testmsg ,Testmsg sendmsg.py、recive.py __init__.py
__init__.py, __init__.py '''
import Testmsg
Testmsg.sendmsg.test1()# sendmsg.py test1