main.py文件

#_*_coding:utf-8_*_
#__author__ = "csy"

from module_csy import say_hello as hello   #module_csy模块的say_hello函数起别名为hello

print(hello())

module_csy.py文件

#_*_coding:utf-8_*_
#__author__ = "csy"

name = 'csy'
def say_hello():
    print('Hello csy!')
执行main.py输出结果:

 


posted on 2017-06-25 18:54  csy113  阅读(158)  评论(0)    收藏  举报