当前位置: 首页 > 图灵资讯 > 行业资讯> python怎样导入自己写的包

python怎样导入自己写的包

发布时间:2025-02-27 18:32:55

python导入自己写的包的方法:

1、导入同级目录的文件可以使用“import 包名”导入

QQ截图20200602154701.png

2、可以使用导入子目录文件from 包名 import 导入“文件名”

QQ截图20200602154820.png

更多Python知识,请关注:Python自学网!!

相关文章

python3兼容python2吗

python3兼容python2吗

2025-05-09
python3 whl怎么安装

python3 whl怎么安装

2025-05-09
python 字典怎么提取value

python 字典怎么提取value

2025-05-09
python 怎样计算字符串的长度

python 怎样计算字符串的长度

2025-05-09
python 怎么样反向输出字符串

python 怎么样反向输出字符串

2025-05-09
python 怎么判断字符串开头

python 怎么判断字符串开头

2025-05-09