发布时间:2019-07-14 10:04:39编辑:auto阅读(1572)
python 的import是需要将项目目录加到python的环境变量里面
这样才能用项目的相对路径来导入文件
要运行文件加入
import os import sys BASEDIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASEDIR)
其它模块就是
from model.basemodel import Basemodel
项目结构
关键字:
上一篇: Python中的类和方法使用举例
下一篇: Python File(文件)方法
48091
46770
37693
35022
29570
26228
25159
20196
19832
18306
5982°
6663°
6157°
6147°
7258°
6098°
6201°
6673°
6642°
8031°