码迷,mamicode.com
首页 > 其他好文 > 详细

29 导入包练习

时间:2020-06-12 20:09:07      阅读:62      评论:0      收藏:0      [点我收藏+]

标签:loading   技术   load   ini   receive   col   测试文件   __init__   ESS   

1  新建  python Package    : mess 文件夹,自动生成空的 __init__.py  ,创建send_mess  ,receive_mess  两个测试文件,

 __init__.py 如下:

from . import receive_mess    
from . import send_mess

2  两个测试文件代码如下:

"""send_mess.py  """
def send(txt):
print(txt)


"""receive_mess.py """
def receive():
return "aaaaaaaaa"
 

3 测试

技术图片

 

29 导入包练习

标签:loading   技术   load   ini   receive   col   测试文件   __init__   ESS   

原文地址:https://www.cnblogs.com/abel2020/p/13107776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!