当前位置: 首页 > 图灵资讯 > 行业资讯> python中__file__属性的使用

python中__file__属性的使用

发布时间:2024-08-08 15:53:05

说明

1、这个__file__属性是模块的特殊属性,类似于__name__。

2、每一次测试都是用python脚本编写的,测试脚本文件的名称就是标题。然后执行这些脚本,使用_file__特殊属性印刷状态。

实例

project/
|
├──tests/
|├──test_commanding.py
|├──test_power.py
|├──test_wireHousing.py
|└──test_leds.py
|
└──main.py

以上是python___file使用__属性,希望对大家有所帮助。更多Python学习指导:python基础教程

本文教程操作环境:windows7系统Python 3.9.1,DELL G3电脑。

相关文章

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