我的文件结构是这样的:
app/
__init__.py
a.py
在__init__.py中定义函数
def fun1():
print('hehe')
在a.py中import,下边的都失败了
from . import fun1
from ..app import fun1
成功的方式有一点粗暴
from .__init__ import fun1
不过没见过这样import的,在网上搜的都不管用,不知道怎么回事。。。。谢谢啦
海绵宝宝撒
墨色风雨
青春有我
随时随地看视频慕课网APP
相关分类