博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python 查找模块的文件路径
阅读量:4287 次
发布时间:2019-05-27

本文共 397 字,大约阅读时间需要 1 分钟。

有时候想知道import的模块的文件路径,看看脚本,可以通过以下方式来查看:

Python 2.6.6 (r266:84292, Jul 23 2015, 15:22:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-11)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> import identmodule>>> print identmodule.__file__/usr/lib/python2.6/site-packages/identmodule/__init__.pyc
通过模块的__file__属性来确定,这时候进入/usr/lib/python2.6/site-packages/identmodule/ 目录就可以查看脚本了

转载地址:http://xdxgi.baihongyu.com/

你可能感兴趣的文章
论文笔记|Distantly Supervised Named Entity Recognition using Positive-Unlabeled Learning
查看>>
论文笔记:Span-Based Event Coreference Resolution
查看>>
NAACL2021阅读理解论文整理
查看>>
论文笔记 | Leveraging Graph to Improve Abstractive Multi-Document Summarization
查看>>
NAACL2021丨Knowledge Guided Metric Learning for Few-Shot Text Classification
查看>>
论文笔记|Deep Open Intent Classification with Adaptive Decision Boundary
查看>>
【论文笔记】
查看>>
论文笔记_Pay Attention to MLPs
查看>>
【论文笔记】
查看>>
论文笔记
查看>>
论文笔记 | Attention-based LSTM for Aspect-level Sentiment Classification
查看>>
【论文笔记】Joint Extraction of Entities and Relations Based on a Novel Tagging Scheme
查看>>
论文笔记|Bidirectional LSTM-CRF Models for Sequence Tagging
查看>>
论文笔记:Constructing Narrative Event Evolutionary Graph for Script Event Prediction
查看>>
论文笔记丨Open Hierarchical Relation Extraction
查看>>
论文笔记| BART:Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation
查看>>
【论文笔记】 | Learning to Retrieve Reasoning Paths over Wikipedia Graph for Question Answering
查看>>
论文笔记 | Adversarial Examples for Evaluating Reading Comprehension Systems
查看>>
2021-06-12
查看>>
论文笔记| The Emergence, Advancement and Future of Textual Answer Triggering
查看>>