问题:在python文件中引用自己创建的文件时报错:ImportError: No module named mantutu.com
解决:包的名称不能包含点(.)
方法:
将文件名由mantutu.com改为mantutu就可以了
引用:from mantutu import getarticles
注:如果引入一个文件夹下文件时,就需要在文件下touch __init__.py
问题:在python文件中引用自己创建的文件时报错:ImportError: No module named mantutu.com
解决:包的名称不能包含点(.)
方法:
将文件名由mantutu.com改为mantutu就可以了
引用:from mantutu import getarticles
注:如果引入一个文件夹下文件时,就需要在文件下touch __init__.py