def search(): module_test.test() print ('in the search')
def logger(): test() print('in the logger')
def logger(): module_test.test()
def search(): test() print('in the search')
#!/usr/bin/env Python #-*- coding:utf-8 -*- #Author:yanshen #import module_test from module_test import test test() def logger(): test() print('in the logger') def search(): test() print('in the search') logger() search()
# -*- coding:utf-8 -*- __author__ = 'Qiushi Huang' """ 程序目录: module_test.py index.py 当前文件: index.py """ import module_test as obj obj.test() print(hasattr(obj, 'test')) getattr(obj, 'test')() """ from the test True from the test """
def search(): test() print("in the search")
def logger(): test() # 调用module_test模块里面的函数 print("in the logger")