python 获取路径
时间: 2023-08-31 19:09:10 浏览: 104
在Python中,可以使用sys模块的sys.path来获取当前执行的Python文件路径。无论是在其他模块中的任何位置,sys.path都会返回相同的值,即当前执行的Python文件路径。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [python 获取路径的几种方法](https://blog.csdn.net/wuchenlhy/article/details/81302159)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [Python文件路径操作汇总,获取文件夹下的所有文件路径](https://blog.csdn.net/Java_ZZZZZ/article/details/130846038)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文