?目的:在index中引入模块start下的方法
1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 4 5 import sys,os 6 BASE_DIR = os.path.dirname(os.path.dirname(__file__)) 7 sys.path.append(BASE_DIR) 8 9 from conf import start 10 start.Say_hi() # hello world
1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 4 5 class Say_hi: 6 print(‘hello world‘)
原文:https://www.cnblogs.com/chenyanbin/p/10398685.html