spyder导入自写python模块

在要导入包的代码开头添加三行代码:

import sys
sys.path.append([自己写的包所在的目录])
import 自写包名称

自写包所在文件目录下添加__init__.py文件,该文件标识自写的模块为包。

猜你喜欢

转载自blog.csdn.net/spatial_coder/article/details/122086563