首先,该变量在模块中是全局变量
在调用该变量的py中要先import 该模块
如:我要调用app 下 compare 模块中的degree 变量
from app import compare
compare.degree
或
from app.compare import degree
degree
不建议使用第二种
原因:1.第一种能很清楚地知道degree是从compare中调用的变量
2.第二种如果此py中也有degree变量,会发生错误
注意在py中引用绝对路径时import相应模块(就是因为这个错误,我改了一下午bugT-T)