chenyanbin

目录示例

 

目的:在index中引入模块start下的方法

index.py

 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

 

start.py

1 #!/usr/bin/env python
2 # -*- coding:utf-8 -*-
3 
4 
5 class Say_hi:
6     print(\'hello world\')

 

分类:

技术点:

相关文章:

  • 2021-12-14
  • 2021-12-04
  • 2021-12-04
  • 2021-10-09
  • 2021-09-29
  • 2021-12-19
  • 2022-01-07
  • 2021-11-11
猜你喜欢
  • 2021-12-14
  • 2021-12-14
  • 2021-12-14
  • 2021-11-28
  • 2021-12-14
  • 2021-12-04
  • 2021-05-10
相关资源
相似解决方案